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

Support eslint 9 #1267

Closed
garak opened this issue Apr 30, 2024 · 8 comments
Closed

Support eslint 9 #1267

garak opened this issue Apr 30, 2024 · 8 comments

Comments

@garak
Copy link

garak commented Apr 30, 2024

Current output:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @symfony/[email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/eslint
npm ERR!   dev eslint@"^9.1.1" from the root project
npm ERR!   peer eslint@"^6.0.0 || ^7.0.0 || >=8.0.0" from @eslint-community/[email protected]
npm ERR!   node_modules/@eslint-community/eslint-utils
npm ERR!     @eslint-community/eslint-utils@"^4.2.0" from [email protected]
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peerOptional eslint@"^8.0.0" from @symfony/[email protected]
npm ERR! node_modules/@symfony/webpack-encore
npm ERR!   dev @symfony/webpack-encore@"^4.6.1" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/eslint
npm ERR!   peerOptional eslint@"^8.0.0" from @symfony/[email protected]
npm ERR!   node_modules/@symfony/webpack-encore
npm ERR!     dev @symfony/webpack-encore@"^4.6.1" 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.

@kumardeepakme
Copy link

Yes, eslint 9 & postcss-loader 8

jMz1eujd20240501104525PMyCJsLh6C

@rugbymauri
Copy link

should be fixed in #1258

@garak
Copy link
Author

garak commented Jun 17, 2024

should be fixed in #1258

But I don't see any change related to eslint there. Indeed, the proposed changes in the PR still use eslint 8.

@Kocal
Copy link
Member

Kocal commented Aug 21, 2024

Hello everyone!

I don't think ESLint 9 will ever be supported. What's more, I'm planning to remove ESLint support from Webpack Encore, and there are several reasons for this:

  1. "Linting while building" was really popular years ago, but things have changed. People now prefer to lint their code as a separate task (in their IDE, in a pre-commit git hook, in a dedicated command, in CI, etc.), and I'm one of them. It slows you, either when you have to lint your code to finally build it, or because the ESLint/ESLint plugin slowness added to the building process: you reduce your velocity!
    Also, see How to turn off ESLint? vuejs-templates/webpack#73. :)
  2. Supporting ESLint in Webpack Encore has not been without its challenges. It required a lot of work (feat: add ESLint 6 support #732, feat: add support for ESLint 7, drop support ESLint 5 #774, Move from eslint-loader to eslint-webpack-plugin, close #847 #985, Allow eslint-webpack-plugin ^4.0 #1190) and sometimes involved some hacks to get things working (I really want to remove the "sync-rpc" dependency).
  3. When you add support for a new major version of ESLint, what do we do about the previous ones? Keeping them, but adding more work to support multiple major versions? Or dropping them, but then we need to tag a new major version for Encore? I don't want ESLint to drive our releases process.
  4. There are far more efficient alternatives, like Biomejs, Oxlint, etc., and I don't want to see support for these in Encore. Code linting should not be related to a bundling tool.

I plan to deprecate ESLint support in the next minor version and drop it in the next major version, but I'm open to discussion!

@stof
Copy link
Member

stof commented Aug 21, 2024

@Kocal I totally agree with that decision (personally, I never enabled the ESLint integration in Encore, while I'm using ESLint since longer than I'm using Encore)

@garak
Copy link
Author

garak commented Aug 21, 2024

@Kocal it's fine for me. My only concern is the error I reported above, if to fix it you have to remove eslint support, go for it.

@Kocal
Copy link
Member

Kocal commented Aug 22, 2024

My only concern is the error I reported above, if to fix it you have to remove eslint support

Yes, after removing the integration, ESLint dependencies will be your concern!
That will be much easier for everyone.

Kocal added a commit that referenced this issue Aug 30, 2024
This PR was merged into the main branch.

Discussion
----------

Drop ESLint integration

Close #1282, see #1267 (comment) for more information.

Removing `Encore.enableEslintPlugin()` from user-land. It will ease Encore maintenance a lot!

Users have three options to migrate:
1. Either re-install `eslint-webpack-plugin` and add the plugin back through `Encore.addPlugin(new EslintPlugin())`
2. **Recommended:** Either use ESLint in a dedicated task, ex: a git hook pre-commit, a dedicated npm script, a step in their CI, ...
3. Use alternative (and faster) tools like Biome.js or Oxlint

Commits
-------

ef70c34 Drop ESLint integration
@Kocal
Copy link
Member

Kocal commented Aug 30, 2024

Closing, as ESLint integration has been removed in #1309 for the next major version of Encore (5).

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

No branches or pull requests

5 participants