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 v9 #2948

Open
Tracked by #2961 ...
DamienCassou opened this issue Dec 30, 2023 · 9 comments · May be fixed by #2996
Open
Tracked by #2961 ...

Support eslint v9 #2948

DamienCassou opened this issue Dec 30, 2023 · 9 comments · May be fixed by #2996

Comments

@DamienCassou
Copy link
Contributor

eslint 9 is being prepared and comes with a lot of changes impacting users and plugin developers: see https://eslint.org/blog/2023/12/eslint-v9.0.0-alpha.0-released/ for example.

What is the status of eslint v9 support for eslint-plugin-import?

@ljharb
Copy link
Member

ljharb commented Dec 30, 2023

Since we don’t even support flat config yet (#2873), and eslint doesn’t provide any replacement for FileEnumerator, I’d say it’ll probably be awhile before we support eslint 9.

@JounQin
Copy link
Collaborator

JounQin commented Dec 30, 2023

At least we can support using eslintrc on eslint v9 currently.

TODO: compatible with some internal API migration like context vs SourceCode.

@ljharb
Copy link
Member

ljharb commented Dec 30, 2023

I'd definitely love to add some tests on eslint 9, using the env var that restores eslintrc, so we can get ahead of any needed changes.

@TiagodePAlves
Copy link

I made a patch for eslint-plugin-import@2.29.1 (and eslint-plugin-i@2.29.1) that works with pnpm and ESLint v9.0.0-beta.2: https://gist.github.com/TiagodePAlves/8c9b1ed4062a484022f5ebf7ba53a5d5

@ljharb
Copy link
Member

ljharb commented Mar 16, 2024

@TiagodePAlves thanks, that's helpful! once we have tests running on eslint 9, it shouldn't be too difficult to adapt that patch into something that works on both v9 and older versions.

@G-Rath
Copy link
Contributor

G-Rath commented Apr 6, 2024

@ljharb fwiw I did a very naive find-and-replace of the context utils we're using in eslint-plugin-jest and it looks like that's all thats needed? specifically also seems that only getSourceCode and getScope are the only two removed context methods being used (or at least out of the rules eslint-plugin-jest is using).

Would you like me to attempt a draft PR? I don't know if I'll have the bandwidth to setup a whole test suite but I figure I can contribute enough to kick start the work 🙂

@ljharb
Copy link
Member

ljharb commented Apr 6, 2024

@G-Rath that might be the case! The blocker really is setting up tests, unfortunately - if we can get tests working on eslint 9, the rest is something I can probably find time for sooner than later :-)

@G-Rath G-Rath linked a pull request Apr 7, 2024 that will close this issue
@ljharb ljharb pinned this issue Apr 15, 2024
@ryanblock
Copy link

@ljharb it may be something that's classified under "it'll take more time to explain than it would take for me [@ljharb] to do it" but if you can scope the test suite work here I or others may be able to help pitch in! 💕

@ljharb
Copy link
Member

ljharb commented Apr 18, 2024

@ryanblock basically:

  1. add eslint 9 to the test matrix
  2. get tests passing on eslint 9

#2996 should cover this eventually. If anyone has contributions, please do NOT open a new PR, and instead, comment a link to the branch or commit on the PR, and the OP or myself can pull them in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

6 participants