Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
1fac68e
refactor: Update ESLint configurations for ESLint 9 compatibility
devinea Oct 30, 2025
c1477c8
Merge remote-tracking branch 'origin/eslint9' into eslint9_merge_fior…
devinea Nov 3, 2025
bd2f3ac
Merge remote-tracking branch 'origin/eslint9' into eslint9_merge_fior…
devinea Nov 11, 2025
c66e62c
fixes
devinea Nov 11, 2025
7fac182
fix lint issue
devinea Nov 11, 2025
f35cfb5
Merge remote-tracking branch 'origin/eslint9' into eslint9_merge_fior…
devinea Nov 13, 2025
55df0ae
Address review feedback:
devinea Nov 17, 2025
8199633
Replace any and move duplicate functions to a utils file.
devinea Nov 17, 2025
3480b33
WIP
devinea Nov 17, 2025
d362fc1
delete reporter
devinea Nov 17, 2025
bbb5465
clean @author and @ESLint
devinea Nov 17, 2025
aa99a67
replace any
devinea Nov 17, 2025
04e46c9
update config
devinea Nov 17, 2025
ea05943
Update packages/eslint-plugin-fiori-tools/src/rules/sap-bookmark-perf…
devinea Nov 17, 2025
68ac224
Update packages/eslint-plugin-fiori-tools/src/rules/sap-message-toast.ts
devinea Nov 17, 2025
23ab068
remove TODO
devinea Nov 17, 2025
0aacfbc
Merge remote-tracking branch 'origin/eslint9_merge_fiori_custom_into_…
devinea Nov 17, 2025
1e78d55
remove commented code
devinea Nov 17, 2025
275b471
feedback
devinea Nov 17, 2025
f61d11a
feedback
devinea Nov 17, 2025
b0319b0
feedback
devinea Nov 17, 2025
c4d60e8
reduce duplicate code
devinea Nov 18, 2025
4a4c24c
feedback - bump to v9
devinea Nov 19, 2025
140edee
reduce duplication
devinea Nov 19, 2025
76c7869
many eslint warning fixes
devinea Nov 19, 2025
7761931
return types eslint warnings
devinea Nov 19, 2025
928b1bb
Fix eslint @typescript-eslint/explicit-function-return-type
devinea Nov 20, 2025
2583868
reduce usage of type any
devinea Nov 20, 2025
fea5e75
Merge remote-tracking branch 'origin/eslint9' into eslint9_merge_fior…
devinea Nov 20, 2025
3d745cc
temp run PR build on eslint branches
devinea Nov 20, 2025
471fdb7
Merge remote-tracking branch 'origin/eslint9' into eslint9_merge_fior…
devinea Nov 20, 2025
d2eddac
revert snapshots
devinea Nov 21, 2025
c32dd5d
add types for prettier so newer types from the root are not resolved.…
devinea Nov 21, 2025
af68a06
Merge remote-tracking branch 'origin/eslint9' into eslint9_merge_fior…
devinea Nov 21, 2025
719dbb3
fix Sonar issues
devinea Nov 24, 2025
ca09977
refactor: update rule functions to use ASTNode type for improved type…
devinea Nov 24, 2025
b2a4831
fix sonar cognitive-complexity
devinea Nov 24, 2025
28e9eae
fiori custom - > fiori tools (fiori custom)
devinea Nov 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .github/workflows/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ on:
push:
branches: [main]
pull_request:
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.

jobs:
build:
strategy:
Expand Down
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ module.exports = [
'.storybook',
'**/snapshotResolver.js',
'**/expected-output/**',
'**/playwright-report/**'
]
},
eslintPluginPrettierRecommended,
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
"eslint-plugin-prettier": "5.2.3",
"eslint-plugin-promise": "7.2.1",
"eslint-plugin-sonarjs": "3.0.2",
"typescript-eslint": "8.46.2",
"globals": "16.0.0",
"husky": "8.0.3",
"jest": "30.2.0",
Expand All @@ -39,6 +38,7 @@
"rimraf": "6.0.1",
"ts-jest": "29.4.5",
"typescript": "5.9.3",
"typescript-eslint": "8.46.2",
"update-ts-references": "3.6.2",
"yargs-parser": "21.1.1"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ module.exports = defineConfig([
languageOptions: {
globals: {
...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.

}
}
}
]);
]);
81 changes: 81 additions & 0 deletions packages/eslint-plugin-fiori-tools/config/eslintrc-prod.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
const { defineConfig } = require('eslint/config');
const babelParser = require('@babel/eslint-parser');
const js = require('@eslint/js');

module.exports = defineConfig([
{
files: ['./webapp/**/*.js', './webapp/**/*.ts'],

ignores: [
'target/**',
'webapp/test/**',
'webapp/localservice/**',
'backup/**',
'**/Gruntfile.js',
'**/changes_preview.js',
'**/changes_preview.ts',
'**/gulpfile.js',
'**/*.d.ts',
'test/**'
],

languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false
}
},

plugins: {
'@sap-ux/fiori-tools': require('../lib/index.js')
},

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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Benefit for me is structure. With current implementation, yes correct if adding new rule, changing existing one does not matter because we have no structure. My taste: it is difficult to get an overview of which rules has which severity. With structure in place, adding or changing severity should be adapted in respective group. That is the purpose.

'@sap-ux/fiori-tools/sap-no-jquery-device-api': 'warn',
'@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-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-absolute-component-path': 'error',
'@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-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-forbidden-window-property': 'warn',
'@sap-ux/fiori-tools/sap-no-navigator': 'error',
'@sap-ux/fiori-tools/sap-no-inner-html-write': 'error',
'@sap-ux/fiori-tools/sap-no-inner-html-access': 'warn',
'@sap-ux/fiori-tools/sap-bookmark-performance': 'warn',
'@sap-ux/fiori-tools/sap-no-commons-usage': 'error',
'@sap-ux/fiori-tools/sap-ui5-no-private-prop': 'off',
'@sap-ux/fiori-tools/sap-browser-api-error': 'off',
'@sap-ux/fiori-tools/sap-browser-api-warning': 'warn',
'@sap-ux/fiori-tools/sap-no-window-alert': 'off',
'@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'
}
}
]);
22 changes: 22 additions & 0 deletions packages/eslint-plugin-fiori-tools/config/eslintrc-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
const { defineConfig } = require('eslint/config');
const babelParser = require('@babel/eslint-parser');

module.exports = defineConfig([{
files: ['webapp/test/**/*.js', 'webapp/test/**/*.ts'],
ignores: ['**/*.d.ts'],

languageOptions: {
parser: babelParser,
parserOptions: {
requireConfigFile: false
}
},

plugins: {
'@sap-ux/fiori-tools': require('../lib/index.js')
},

rules: {
'@sap-ux/fiori-tools/sap-opa5-autowait-true': 'warn'
}
}]);
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
const {
defineConfig,
} = require("eslint/config");

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

const tseslint = require('typescript-eslint');



module.exports = defineConfig([
{
files: ["./webapp/*.ts", "./webapp/**/*.ts"],

ignores: [
"target/**",
"webapp/test/changes_loader.ts",
"webapp/test/changes_preview.ts",
"webapp/localservice/**",
"webapp/localService/**",
"undefined/**/Example.qunit.ts",
"backup/**",
"**/*.d.ts",
],

plugins: {
"@typescript-eslint": typescriptEslint,
},

languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "script",

parserOptions: {
projectService: true,
},
},

rules: {
...typescriptEslint.configs.recommended.rules,
...typescriptEslint.configs['recommended-type-checked'].rules,
"@typescript-eslint/no-unsafe-call": "warn",
"@typescript-eslint/no-unsafe-member-access": "warn",
"@typescript-eslint/no-unsafe-return": "warn",
"@typescript-eslint/no-unsafe-argument": "warn",
"@typescript-eslint/no-unsafe-assignment": "warn",
},
}
]);
38 changes: 0 additions & 38 deletions packages/eslint-plugin-fiori-tools/config/flat/eslintrc-prod.js

This file was deleted.

26 changes: 0 additions & 26 deletions packages/eslint-plugin-fiori-tools/config/flat/eslintrc-test.js

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading