Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Installing JHipster 8.7.0 has warnings about eslint #27091

Closed
mraible opened this issue Aug 27, 2024 · 5 comments · Fixed by #27095
Closed

Installing JHipster 8.7.0 has warnings about eslint #27091

mraible opened this issue Aug 27, 2024 · 5 comments · Fixed by #27095
Labels
area: bug 🐛 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/
Milestone

Comments

@mraible
Copy link
Contributor

mraible commented Aug 27, 2024

Overview of the issue
npm warn ERESOLVE overriding peer dependency
npm warn While resolving: eslint-plugin-import@2.29.1
npm warn Found: eslint@9.9.1
npm warn node_modules/generator-jhipster/node_modules/eslint
npm warn   eslint@"9.9.1" from generator-jhipster@8.7.0
npm warn   node_modules/generator-jhipster
npm warn     generator-jhipster@"*" from the root project
npm warn   2 more (eslint-plugin-unused-imports, @eslint-community/eslint-utils)
npm warn
npm warn Could not resolve dependency:
npm warn peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from eslint-plugin-import@2.29.1
npm warn node_modules/generator-jhipster/node_modules/eslint-plugin-import
npm warn   eslint-plugin-import@"2.29.1" from generator-jhipster@8.7.0
npm warn   node_modules/generator-jhipster
npm warn
npm warn Conflicting peer dependency: eslint@8.57.0
npm warn node_modules/eslint
npm warn   peer eslint@"^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" from eslint-plugin-import@2.29.1
npm warn   node_modules/generator-jhipster/node_modules/eslint-plugin-import
npm warn     eslint-plugin-import@"2.29.1" from generator-jhipster@8.7.0
npm warn     node_modules/generator-jhipster

added 705 packages in 5s

229 packages are looking for funding
  run `npm fund` for details
Motivation for or Use Case

There shouldn't be warnings when installing JHipster.

Reproduce the error
npm i -g generator-jhipster
Related issues

#26914

@jhipster jhipster deleted a comment Aug 27, 2024
@mraible mraible changed the title Installing JHipster 8.7.1 has warnings about eslint Installing JHipster 8.7.0 has warnings about eslint Aug 27, 2024
@emilpaw
Copy link
Contributor

emilpaw commented Aug 27, 2024

This plugin does not support eslint 9: import-js/eslint-plugin-import#2948

These are the used rules:

'import/no-unresolved': 'error',
'import/default': 'error',
'import/export': 'error',
'import/order': 'error',

'import/no-named-as-default': 'warn',
'import/no-duplicates': 'warn',
'import/extensions': [0, { pattern: { '{c,m,}{js,ts}': 'always' } }],

The errors (except order) are handled by TypeScript directly and the rest is either not really applicable in TypeScript or not that useful. VSCode has a code suggestion similar to no-duplicates and order and alternatively this prettier plugin could be used: https://www.npmjs.com/package/prettier-plugin-organize-imports

I suggest to just remove eslint-plugin-import.

@mraible mraible added area: bug 🐛 $100 https://www.jhipster.tech/bug-bounties/ $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ and removed area: triage theme: undefined labels Aug 27, 2024
@mraible
Copy link
Contributor Author

mraible commented Aug 27, 2024

Added bug bounty to get this fixed.

@mshima
Copy link
Member

mshima commented Aug 27, 2024

This is a npm bug.
Overrides is in place:

"overrides": {
"eslint-plugin-import": {
"eslint": "$eslint"
},

@mshima
Copy link
Member

mshima commented Aug 27, 2024

The errors (except order) are handled by TypeScript directly and the rest is either not really applicable in TypeScript or not that useful. VSCode has a code suggestion similar to no-duplicates and order and alternatively this prettier plugin could be used: https://www.npmjs.com/package/prettier-plugin-organize-imports

I suggest to just remove eslint-plugin-import.

eslint-plugin-import is not added to typescript projects only.
It's added to add a common config to blueprints at generator-jhipster/eslint/recommended.

@emilpaw
Copy link
Contributor

emilpaw commented Aug 27, 2024

@mshima Thanks for clarifying. After the fix is merged I will close my PR and create a new PR with the fixes I made to the issues which surfaced after changing the configuration.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: bug 🐛 $$ bug-bounty $$ https://www.jhipster.tech/bug-bounties/ $100 https://www.jhipster.tech/bug-bounties/
Projects
None yet
3 participants