Skip to content

Conversation

@ManuelPastorini
Copy link
Contributor

Initial changes

@ManuelPastorini ManuelPastorini requested review from a team as code owners October 28, 2025 14:42
@changeset-bot
Copy link

changeset-bot bot commented Oct 28, 2025

⚠️ No Changeset found

Latest commit: 76a5876

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

export default defineConfig([
{
files: ["**/manifest.json"],
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The manifest.json must be located in webapp - any file named manifest.json but located elsewhere should be irrelevant. Thus, this should read

Suggested change
files: ["**/manifest.json"],
files: ["webapp/manifest.json"],

Copy link
Contributor

@heimwege heimwege Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not correct. The name of the webapp folder is defined in the UI5 yaml configuration and can be any name. /webapp is just the default (see https://ui5.github.io/cli/stable/pages/Configuration/#available-path-mappings).
That's why everybody should use the getWebappPath method from @sap-ux/project-access instead of hard code to webapp.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I had asked @hitesh-parmar about this. Anyway, we need to tell in the eslint plugin which files the language is for - just defining all files named manifest.json regardless where they are located cannot be correct. @heimwege Should we set ui5.yaml, and then start reading everything from there? Or could this also be wrong?
@heimwege

export default defineConfig([
{
files: ["**/manifest.json"],
plugins: { fiori },
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to the naming convention from eslint for plugins and their packages and node-modules, this should read

Suggested change
plugins: { fiori },
plugins: { @sap-ux/fiori-tools },

However, I'm not sure about the import statement in line 29 - maybe this allows to use a different name

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can import the plugin with any name, then you need to refer to it in the config definition (in extends, language used from the plugin). I guess you propose to change the package name?

import { defineConfig } from "eslint/config";
import fiori from "@sap-ux/eslint-plugin-fiori-tools";
export default defineConfig([
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should not ask consumers to import and call defineConfig in a specific way, but rather do this ourselves and provide a ready-to-use configuration (like defaultTS, defaultJS,...)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If consumer wants to use the plugin they need eslint and an eslint config file. The config exported from the plugin is called "manifest" used in line 35 and defined here:

manifest: {
plugins: {},
rules: { 'consistency/flex-enabled': 'warn' }
}

There can be multiple configs added in the future, also consumer can ignore it and defined a set of rules in a projects' eslint config themselves.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should provide configurations in a way to make it as simple as possible to use them as they are for applications. If we do that correct, applications eslint.config.mjs can look as simple as
export default config from "@sap-ux/eslint-plugin-fiori-tools/<config>";
(where should be the relevant name, depending on whether the app is being delivered from SAP, part of S/4 or own development from a customer).
This also allows apps to import the configuration, extend it, and override anything they want to - but we should not enforce this to be the standard case!

@heimwege heimwege marked this pull request as draft October 28, 2025 16:17
@sonarqubecloud
Copy link

Quality Gate Failed Quality Gate failed

Failed conditions
72.4% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants