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

Closed
Tracked by #26 ...
DamienCassou opened this issue Dec 30, 2023 · 20 comments · Fixed by #2996
Closed
Tracked by #26 ...

Support eslint v9 #2948

DamienCassou opened this issue Dec 30, 2023 · 20 comments · 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.

@marmitar
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 :-)

@ljharb ljharb pinned this issue Apr 15, 2024
@import-js import-js unlocked this conversation Sep 30, 2024
@kachkaev
Copy link

kachkaev commented Sep 30, 2024

Amazing news on merging #2996 🎉

It’d be great to see a new release by the end of the week, because v8 reaches EOL on Saturday. At the time of writing, the latest release is v2.30.0 (2024-09-03).

@ljharb
Copy link
Member

ljharb commented Oct 1, 2024

I'm traveling right now, but I should be able to get a release out before the end of the week.

jcronenberg pushed a commit to jcronenberg/agama that referenced this issue Oct 1, 2024
Which has implied,

* Drop eslint-plugin-import in favor of eslint-plugin-import-x

  Since the eslint-plugin-import support for ESLint 9 is kind of a
  blocker for such an update at this moment. See import-js/eslint-plugin-import#2948

* Update eslint-plugin-react-hooks to an RC version

  For moving this update on without waiting until the support reach the
  @latest version. See facebook/react#30932 (comment)

As commented at
import-js/eslint-plugin-import#2948 (comment),

>  the ESLint plugin ecosystem is getting harder and harder to maintain,
>  and things get worse during major version upgrades.
jcronenberg pushed a commit to jcronenberg/agama that referenced this issue Oct 1, 2024
Update web dependencies to their latest versions via `npm update` and
`npm install package-name@latest` when needed.

## Additional notes

* ESLint has been updated to the latest v9. To do so,
_eslint-config-standard_ plugins were replaced by
[_neostandard_](https://github.com/neostandard/neostandard). See
agama-project@b447bc2
and
agama-project@5433c00

* Now, the ESLint configuration lives at _eslint.config.mjs_. See ESLint
migration guide https://eslint.org/docs/latest/use/migrate-to-9.0.0

* Linters check now (?) TypeScript files

* A lot of linters complaints has been fixed. See commit by commit if
interested.

* **As a result of the migration, two icons were removed**. One of them
was actually not in use. To know more see
agama-project@a5c43a0

### Special mention for
agama-project@89214a7

As you can see in linked commit, the `useVolumeTemplates` query hook has
changed significantly when fixing linters complaints. It was using a
hook conditionally, breaking the `Do not call Hooks after a conditional
return statement.` [rule of
hooks](https://react.dev/reference/rules/rules-of-hooks).

Although the change was done following the [TanStack Query
documentation](https://tanstack.com/query/v5/docs/framework/react/guides/dependent-queries#usequeries-dependent-query),
it has been manually tested too in order to check that everything works
as expected when `useProductParams` returns `undefined`. And,
apparently, it works: the `Add filesystem` button became disable.

## A quote

> the ESLint plugin ecosystem is getting harder and harder to maintain,
> and things get worse during major version upgrades — read in a
[comment at
eslint-pluign-import](import-js/eslint-plugin-import#2948 (comment))

---

Previous update: agama-project#1184
sethidden added a commit to vuestorefront/vue-storefront that referenced this issue Oct 2, 2024
eslint-plugin-import doesn't support v9 yet, but there'll posibly be a
release this week
import-js/eslint-plugin-import#2948 (comment)
sethidden added a commit to vuestorefront/vue-storefront that referenced this issue Oct 2, 2024
eslint-plugin-import doesn't support v9 yet, but there'll posibly be a
release this week
import-js/eslint-plugin-import#2948 (comment)
sethidden added a commit to vuestorefront/vue-storefront that referenced this issue Oct 2, 2024
eslint-plugin-import doesn't support v9 yet, but there'll posibly be a
release this week
import-js/eslint-plugin-import#2948 (comment)
sethidden added a commit to vuestorefront/vue-storefront that referenced this issue Oct 2, 2024
eslint-plugin-import doesn't support v9 yet, but there'll posibly be a
release this week
import-js/eslint-plugin-import#2948 (comment)
sethidden added a commit to vuestorefront/vue-storefront that referenced this issue Oct 2, 2024
eslint-plugin-import doesn't support v9 yet, but there'll posibly be a
release this week
import-js/eslint-plugin-import#2948 (comment)
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.