-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
@wordpress/scripts lint-js not compatible with newer versions of ESLint (ESLint 9+) #55499
Comments
It looks like the code doesn't detect the new config format introduced recently, as I don't see gutenberg/packages/scripts/scripts/lint-js.js Lines 23 to 33 in 11df44a
Another question that might be related here is whether we want to start using the new config format introduced in v8.21.0 as the default config: gutenberg/packages/scripts/scripts/lint-js.js Lines 35 to 40 in 11df44a
|
Hi @gziolo I tested this bug, and here are my findings:
I have two solutions in my mind:
Please let me know, as I am a newbie to this package management system and may need a different approach. |
Forcing everyone to use ESLint 9, even if done in a new major release, is going to be very painful. I suggest supporting both versions as long as possible, maybe with versions checks or by leveraging |
I think I'm encountering issues that are related to this, but not entirely certain. I've been trying to get ESLint operational in VS Code. I have ESLint extension activated, but I'm seeing issues with Gutenberg's configuration:
There is more, but I'm truncating it there |
@colorful-tones I think that's unrelated. The ninth Line 339 in 9cc96a7
For some reason Lines 34 to 37 in 9cc96a7
|
Great spot there @swissspidy! I would think running Line 275 in 41c80e8
and Line 271 in 41c80e8
But it does not and I see TypeScript issues in console when attempting to lint, e.g.
However, this is all likely not related to this main issue. It does seem like ESLint could use some attention in Gutenberg though, as there are quite a few issues that are overlapping (or seems so) with mine. #54305, and the other 231 other results. Anyways, not related and please disregard. Thanks! |
Closing in favor of #64782 which has an active PR. |
Description
The
lint-js
script in the@wordpress/scripts
package does not work properly with the new ESLint configuration file format (I tested on 8.51.0, but it likely affects older versions as well). It appears thatlint-js
is passing obsolete CLI arguments to ESLint, causing the errors.For example, if you run it without specifying the
--config
parameter, you getInvalid option '--eslintrc' - perhaps you meant '--ignore'?
If you try to resolve the error by adding the
--config
param, you get this error instead:Invalid option '--ext' - perhaps you meant '-c'?
Step-by-step reproduction instructions
npm init
and `npm install '@wordpress/scripts' --save-deveslint.config.js
file with any valid config options.npx wp-scripts lint-js
npx wp-scripts lint-js --config eslint.config.js
Screenshots, screen recording, code snippet
No response
Environment info
Device: Arch Linux with kernel version Linux 6.5.3-zen1-1-zen
Please confirm that you have searched existing issues in the repo.
Yes
Please confirm that you have tested with all plugins deactivated except Gutenberg.
Yes
The text was updated successfully, but these errors were encountered: