Skip to content

Conversation

@devinea
Copy link
Member

@devinea devinea commented Oct 30, 2025

  • Migrate eslint-plugin-fiori-custom from rel-npmjs branch
  • Convert to TypeScript with passing tests
  • Update ESLint configurations and improve rule definitions
  • Change TypeScript ESLint configuration to use recommendedTypeChecked
  • Enhance rule exports for better compatibility and lazy loading
  • Remove author information from rule files for consistency
  • Add fiori-custom plugin for backward compatibility
  • Fix eslint-plugin-eslint-plugin lint issues
  • Apply multiple lint fixes throughout the codebase

- Migrate eslint-plugin-fiori-custom from rel-npmjs branch
- Convert to TypeScript with passing tests
- Update ESLint configurations and improve rule definitions
- Change TypeScript ESLint configuration to use recommendedTypeChecked
- Enhance rule exports for better compatibility and lazy loading
- Remove author information from rule files for consistency
- Add fiori-custom plugin for backward compatibility
- Fix eslint-plugin-eslint-plugin lint issues
- Apply multiple lint fixes throughout the codebase
@changeset-bot
Copy link

changeset-bot bot commented Oct 30, 2025

⚠️ No Changeset found

Latest commit: 28e9eae

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

…i_custom_into_fiori_tools_plugin

* origin/eslint9:
  chore: apply latest changesets
  3792/handle missing mta binary (#3793)
  chore: apply latest changesets
  feat(sap-systems): adds new SAP Systems extension (#3752)
  chore: apply latest changesets
  fix(backend-proxy-middleware): wrong 'path' and 'pathReplace' in case of appStudio full destination (#3787)
…i_custom_into_fiori_tools_plugin

* origin/eslint9: (52 commits)
  chore: apply latest changesets
  update building block svg (#3826)
  chore: apply latest changesets
  feat(create): auto generate readme on build (#3760)
  chore: apply latest changesets
  Resolve Transport Request Checks for Download Quick Fiori App Deploy (#3819)
  test: v4 project builder (#3682)
  chore: apply latest changesets
  fix: bump specVersion to v4.0 (#3744)
  chore: apply latest changesets
  test: Integration test for fiori MCP using promptfoo (#3705)
  chore: apply latest changesets
  fix: move message to store creds prompt, tests, changeset (#3820)
  chore: apply latest changesets
  fix: bump fallback versions (#3813)
  chore: apply latest changesets
  chore - upgrade ui5 devDeps (#3771)
  correct publisher to SAPOSS (#3817)
  chore: apply latest changesets
  fix: cloud system render logic, message wording, test connection logging (#3811)
  ...
Copy link
Contributor

@heimwege heimwege left a comment

Choose a reason for hiding this comment

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

See comments

  • a lot of older notation is being used here (could also be refactored after merge). Did not check all rules but I think the pattern is clearly visible 😄
  • a lot of any types
  • a lot of comments with code that might no longer be needed 🤷🏻
  • migration of eslint config lgtm
  • linting adjustment to existing packages lgtm

...globals.browser,
...globals.node
...globals.node,
'sap': 'readonly'
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity: why is this needed?

Copy link
Member Author

Choose a reason for hiding this comment

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

Addresses error
1:1 error 'sap' is not defined no-undef
E.g. in file https://github.com/SAP/open-ux-tools/blob/main/packages/fiori-freestyle-writer/templates/common/add/1.120.0/webapp/model/models.js#L1
Not sure if there is a better way to handle this.

* @param a
* @param obj
*/
function contains(a, obj) {
Copy link
Contributor

Choose a reason for hiding this comment

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

there should be types, right?

* @param s
* @param sub
*/
function endsWith(s, sub) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Where are all those parameter types gone? Seems a general issue in this rule file

heimwege

This comment was marked as duplicate.

devinea and others added 17 commits November 13, 2025 16:03
…i_custom_into_fiori_tools_plugin

* origin/eslint9:
  Move cpe integration test (#3783)
  chore: apply latest changesets
  fix(fiori-docs-embeddings): use existing ux-ui5-readme in case of error (#3830)
  chore: apply latest changesets
  feat(ADP)(OData): Display in the Info center the OData service connectivity status at startup of the Visual Editor. (#3560)
  Revert "fix: run tests on windows (#3823)" (#3835)
  fix for lint commit not starting the main build on the PR (#3833)
  chore: apply latest changesets
  Updating remaining ui5 cli references to v4 and align version (#3824)
  chore: apply latest changesets
  feat: Replace existing inbounds scenario now replaces all inbounds in FLP configuration generator for ADP (#3773)
  chore: apply latest changesets
  fix: improve handling for saving systems (#3828)
  chore: apply latest changesets
  chore: Update `@sap/cf-tools` version to latest to avoid security issues (#3809)
  chore: apply latest changesets
  feat(fiori-docs-embeddings): add @sap-ux/create/README.md as resource (#3779)
  fix: run tests on windows (#3823)
Removed /*eslint-disable strict*/
Replaced any types with proper TypeScript types
Optional chaining
Use template literals instead of string concatenation
Use Array.at(-1) for accessing last elements
Removed commented-out code blocks
Replaced non-inclusive language
…fiori_tools_plugin' into eslint9_merge_fiori_custom_into_fiori_tools_plugin

* origin/eslint9_merge_fiori_custom_into_fiori_tools_plugin:
  Update packages/eslint-plugin-fiori-tools/src/rules/sap-message-toast.ts
  Update packages/eslint-plugin-fiori-tools/src/rules/sap-bookmark-performance.ts
Copy link
Contributor

@Klaus-Keller Klaus-Keller left a comment

Choose a reason for hiding this comment

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

@devinea @heimwege

Would it make sense to change version of @sap-ux/eslint-plugin-fiori-tools to 9.0.0 to reflect eslint compatibility?

@devinea
Copy link
Member Author

devinea commented Nov 19, 2025

@devinea @heimwege

Would it make sense to change version of @sap-ux/eslint-plugin-fiori-tools to 9.0.0 to reflect eslint compatibility?

@Klaus-Keller yes. Done in 4a4c24c

…i_custom_into_fiori_tools_plugin

* origin/eslint9:
  fix(deps): update dependency js-yaml [security] (#3840)
  chore: apply latest changesets
  fix(odata-service-inquirer): Validation messages for credential fail (#3815)
  chore: apply latest changesets
  sap-systems-ext: update extension name and readme (#3849)
  chore: apply latest changesets
  fix(sap-systems-ext):  title update and import fix for sap systems ext (#3843)
  chore: apply latest changesets
  fix(odata-service-inq): add try catch to fetching backend systems from store (#3839)
  chore: apply latest changesets
  feat: Store view name as part of additional info in fragment body (#3696)
  chore: apply latest changesets
  feat(fpm-writer): Filter building block custom filter (#3767)
  chore: apply latest changesets
  fix(mcp-server): allow to create object pages in v2 (#3795)
  feat: add test cases for java project (#3825)
  chore: apply latest changesets
  fix: inlude require when generate custom field fragment with event handler (#3836)
…i_custom_into_fiori_tools_plugin

* origin/eslint9:
  revert templates and snapshots
@heimwege
Copy link
Contributor

@devinea your thought on not adjusting the version in the package.json and deleting the cset to not get a version bump (to npm.js) in this PR because the following things need to be done as well:

  1. the config names (defaultJS, defaultTS, etc.) are subject to change or enhanced. So we might introduce empty configs (or not yet containing the full list of rules) but also not enforcing a new incompatible change (leading to potentially new major version)
  2. the alias for the rules from eslint-plugin-fiori-custom must be added to avoid errors from esling for wrong eslint-disable-next-line statements referring to no longer existing rules in apps using @sap-ux/eslint-plugin-fiori-tools
    So we could do follow-up PRs to not further improve the complexity of this one?

… Should be removed again when prettier upgraded
…i_custom_into_fiori_tools_plugin

* origin/eslint9:
  chore: apply latest changesets
  fix: System SAPUI5 version not available for selection in ADP generator (#3851)
  chore: apply latest changesets
  Fix(preview-middleware): adjust fallback ui5 version (#3722)
@sonarqubecloud
Copy link

Copy link
Contributor

@marufrasully marufrasully left a comment

Choose a reason for hiding this comment

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

thanks @devinea

  • in general looks good to me
  • small comments
  • did not test it locally

branches: [main]
branches:
- main
- 'eslint9**'
Copy link
Contributor

Choose a reason for hiding this comment

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

this is meant for only current PR or we plane to have another branch?

Copy link
Member Author

Choose a reason for hiding this comment

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

I also have this PR #3827
It can be removed later.


rules: {
...js.configs.recommended.rules,
'@sap-ux/fiori-tools/sap-no-global-variable': 'error',
Copy link
Contributor

Choose a reason for hiding this comment

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

It may make sense to sort them. AI can help here :)

              rules: {
            ...js.configs.recommended.rules,
            // Error rules
            '@sap-ux/fiori-tools/sap-no-global-variable': 'error',
            '@sap-ux/fiori-tools/sap-no-hardcoded-color': 'error',
            '@sap-ux/fiori-tools/sap-no-hardcoded-url': 'error',
            '@sap-ux/fiori-tools/sap-no-localstorage': 'error',
            '@sap-ux/fiori-tools/sap-no-override-rendering': 'error',
            '@sap-ux/fiori-tools/sap-no-override-storage-prototype': 'error',
            '@sap-ux/fiori-tools/sap-no-sessionstorage': 'error',
            '@sap-ux/fiori-tools/sap-no-ui5base-prop': 'error',
            '@sap-ux/fiori-tools/sap-no-absolute-component-path': 'error',
            '@sap-ux/fiori-tools/sap-no-location-reload': 'error',
            '@sap-ux/fiori-tools/sap-no-global-event': 'error',
            '@sap-ux/fiori-tools/sap-no-exec-command': 'error',
            '@sap-ux/fiori-tools/sap-no-br-on-return': 'error',
            '@sap-ux/fiori-tools/sap-no-dynamic-style-insertion': 'error',
            '@sap-ux/fiori-tools/sap-no-element-creation': 'error',
            '@sap-ux/fiori-tools/sap-no-global-define': 'error',
            '@sap-ux/fiori-tools/sap-no-navigator': 'error',
            '@sap-ux/fiori-tools/sap-no-inner-html-write': 'error',
            '@sap-ux/fiori-tools/sap-no-commons-usage': 'error',
            // Warning rules
            '@sap-ux/fiori-tools/sap-no-jquery-device-api': 'warn',
            '@sap-ux/fiori-tools/sap-message-toast': 'warn',
            '@sap-ux/fiori-tools/sap-no-ui5-prop-warning': 'warn',
            '@sap-ux/fiori-tools/sap-no-localhost': 'warn',
            '@sap-ux/fiori-tools/sap-usage-basemastercontroller': 'warn',
            '@sap-ux/fiori-tools/sap-no-encode-file-service': 'warn',
            '@sap-ux/fiori-tools/sap-no-dom-insertion': 'warn',
            '@sap-ux/fiori-tools/sap-cross-application-navigation': 'warn',
            '@sap-ux/fiori-tools/sap-no-location-usage': 'warn',
            '@sap-ux/fiori-tools/sap-timeout-usage': 'warn',
            '@sap-ux/fiori-tools/sap-no-proprietary-browser-api': 'warn',
            '@sap-ux/fiori-tools/sap-no-dom-access': 'warn',
            '@sap-ux/fiori-tools/sap-no-history-manipulation': 'warn',
            '@sap-ux/fiori-tools/sap-no-global-selection': 'warn',
            '@sap-ux/fiori-tools/sap-forbidden-window-property': 'warn',
            '@sap-ux/fiori-tools/sap-no-inner-html-access': 'warn',
            '@sap-ux/fiori-tools/sap-bookmark-performance': 'warn',
            '@sap-ux/fiori-tools/sap-browser-api-warning': 'warn',
            '@sap-ux/fiori-tools/sap-ui5-legacy-jquerysap-usage': 'warn',
            '@sap-ux/fiori-tools/sap-ui5-global-eval': 'warn',
            '@sap-ux/fiori-tools/sap-ui5-legacy-factories': 'warn',
            '@sap-ux/fiori-tools/sap-ui5-forms': 'warn',
            // Off rules
            '@sap-ux/fiori-tools/sap-ui5-no-private-prop': 'off',
            '@sap-ux/fiori-tools/sap-browser-api-error': 'off',
            '@sap-ux/fiori-tools/sap-no-window-alert': 'off'
        }

Copy link
Member Author

Choose a reason for hiding this comment

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

Group by error, warn and off and sort within by rule name?

Copy link
Contributor

Choose a reason for hiding this comment

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

Group by error, warn and off.

Copy link
Contributor

Choose a reason for hiding this comment

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

What is the benefit of grouping them by severity because that is something that can change? I can see a scenario where you introduce a new rule and start as warning and later on change it to error, but then you have to also reorder them and that seems a bit strange.


const typescriptEslint = require("@typescript-eslint/eslint-plugin");
const tsParser = require("@typescript-eslint/parser");
const js = require("@eslint/js");
Copy link
Contributor

Choose a reason for hiding this comment

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

js and tseslint seems un-used


For example Windows uses CR+LF (carriage return and line-feed characters) whereas Unix only uses the LF character.

Mixed kinds of line-endings in the same repository can cause code reviews or automatic merging to be .
Copy link
Contributor

Choose a reason for hiding this comment

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

to be ? we are missing a verb here.

"@sap/ux-ui5-tooling": "1",
"@sap-ux/eslint-plugin-fiori-tools": "^0.5.0",
"eslint": "^9",
"@sap-ux/eslint-plugin-fiori-tools": "^0.4.0",
Copy link
Contributor

Choose a reason for hiding this comment

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

can we use "workspace:*" instead?

Copy link
Member Author

Choose a reason for hiding this comment

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

No. The expected output are not part of the workspace.

// may not be available when the plugin itself is loaded
export const configs = {
// Recommended config for JavaScript projects (prod + test)
get recommended(): Linter.Config[] {
Copy link
Contributor

Choose a reason for hiding this comment

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

can we stick to only recommended and recommended-typescript?

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.

6 participants