open-ux-tools
open-ux-tools copied to clipboard
FEATURE - Support `@typescript-eslint/*` v7 for `@sap-ux/eslint-plugin-fiori-tools`
As a developer,
I want to use eslint v7 in combination with @sap-ux/eslint-plugin-fiori-tools,
so that I can benefit from the latest eslint functionality.
Description
Support eslint v7 in NPM package @sap-ux/eslint-plugin-fiori-tools. The package already uses eslint v7 (7.32.0) as dev dependency and should therefore be compatible with eslint v7 in general. However, the package also declares a fixed peer dependency on eslint v5 (^5.59.0) which let's the installation fail with eslint v7.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: <my package>@1.0.0
npm ERR! Found: @typescript-eslint/[email protected]
npm ERR! node_modules/@typescript-eslint/eslint-plugin
npm ERR! dev @typescript-eslint/eslint-plugin@"^7.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @typescript-eslint/eslint-plugin@"^5.59.0" from @sap-ux/[email protected]
npm ERR! node_modules/@sap-ux/eslint-plugin-fiori-tools
npm ERR! dev @sap-ux/eslint-plugin-fiori-tools@"^0.3.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
Technical Design
Update dependencies.
Acceptance Criteria
Given I have a project relying on eslint v7
when I want to use the @sap-ux/eslint-plugin-fiori-tools package
then the NPM installation will not fail due to peer dependency declaration.
Notes
Tasks
- [ ]
- [ ] Unit Tests added
- [ ] Test Cases defined
@henri-kohlberg - Could you share your package.json ?
Your devDependencies should look something like this in the project ?
"devDependencies": {
"@ui5/cli": "^3.0.0",
"@sap/ux-ui5-tooling": "1",
"eslint": "7.32.0",
"@sap/eslint-plugin-ui5-jsdocs": "2.0.5",
"@sapui5/ts-types": "~1.76.0",
"@sap-ux/eslint-plugin-fiori-tools": "^0.2.0",
"eslint-plugin-fiori-custom": "2.6.7",
"@babel/eslint-parser": "7.14.7",
"@sap-ux/ui5-middleware-fe-mockserver": "2"
},
Hi @devinea, the list of dependencies is quite long. The minimum list of packages to run into this issue is:
"devDependencies": {
"@sap-ux/eslint-plugin-fiori-tools": "0.3.1",
"@typescript-eslint/eslint-plugin": "^7.1.0",
"@typescript-eslint/parser": "^7.1.0",
"eslint": "^8.56.0"
}
I think I misunderstood this issue previously. @sap-ux/[email protected] has a peer dependency on @typescript-eslint/*@^5.59.0 which locks the major version of @typescript-eslint/* to v5. Version 6 of @typescript-eslint/parser was released 8 months ago, version 7 is 3 weeks old. Is there any specific reason to pin the major version of this peer dependency? Or could you just define the peer dependency as >=5.59.0 for the @typescript-eslint/* dependencies? The eslint peer dependency already uses this notation too.
@henri-kohlberg
Yes i think it makes sense to support @typescript-eslint/* V7 (also eslint v8 ).
I will need to check some pipelines to check for compatibility and also the project templates for any errors with new @typescript-eslint rules. This make take some time.
@henri-kohlberg This was completed in https://github.com/SAP/open-ux-tools/pull/1738. Sorry I forgot to update here at the time. I'll close this. Please let me know if there is anything else needed.