@shopify/eslint-plugin: Add support for ESLint v9 and flat config
Overview
ESLint v9 was released 2 months ago: https://eslint.org/blog/2024/04/eslint-v9.0.0-released/
Type
- [ ] New feature
- [x] Changes to existing features
Motivation
What inspired this feature request? What problems were you facing, or what else makes you think this should be included?
Impossible to use @shopify/eslint-plugin with ESLint v9
Labels
- [ ] Add the
Type: Feature Requestlabel to this issue.
Area
- [ ] Add any relevant
Area: <area>labels to this issue
Scope
-
Is this issue related to a specific package?
- [ ] Tag it with the
Package: <package_name>label.
- [ ] Tag it with the
-
Is it related to a new package?
- [ ] Tag it with the
New packageLabel
- [ ] Tag it with the
Checklist
- [ ] Please delete the labels section before submitting your issue
- [ ] I have described this issue in a way that is actionable (if possible)
This is important to address, as there is the danger that updating to ESLint v9 can result in checks being silently skipped:
https://github.com/Shopify/vscode-shopify-metrics/pull/614
https://github.com/Shopify/web/pull/135110 should help move this forward.
This should be solved by the latest release:
https://github.com/Shopify/web-configs/releases/tag/%40shopify%2Feslint-plugin%4046.0.0
v46.0.0 migrates us to use flat config, however several of our dependencies do not yet support ESLint v9. We're blocked from going all in on eslint v9 till they update or we institute workarounds.
You can see this in action by trying to bump eslint to v9 within this repository and see that our tests that load and execute our eslint config fails.
It looks like we need to:
- Update all our eslint-plugin dependencies
- Migrate from eslint-plugin-node to eslint-plugin-n - as eslint-plugin-node has been dead for 4+ years and n is its maintained successor
- Wait for
@typescript-eslint/eslint-pluginto release a stable v8, (it is currently in beta). - Wait for the following packages to bump their eslint support to avoid peerDependency warnings:
warning "workspace-aggregator-42858178-9f3d-4034-bb05-5257dc9d3951 > @shopify/eslint-plugin > @typescript-eslint/[email protected]" has incorrect peer dependency "eslint@^8.56.0".
warning "workspace-aggregator-42858178-9f3d-4034-bb05-5257dc9d3951 > @shopify/eslint-plugin > @typescript-eslint/[email protected]" has incorrect peer dependency "eslint@^8.56.0".
warning "workspace-aggregator-42858178-9f3d-4034-bb05-5257dc9d3951 > @shopify/eslint-plugin > [email protected]" has incorrect peer dependency "eslint@^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8".
warning "workspace-aggregator-42858178-9f3d-4034-bb05-5257dc9d3951 > @shopify/eslint-plugin > [email protected]" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0".
TypeScript ESLint v8 has been released https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.0.0
I'm curious what the status of this is or if there's any assistance that can be offered? I see that there's an open PR for the eslint-plugin-n migration (#388). Anywhere else could use help or is it just waiting for dependencies at this point?
eslint-plugin-import is still working on ESLint v9 support.
There's nothing to do here - we're still waiting for our dependencies. Things have moved further along compared to July, but they're not there yet.
Got it, thanks Ben!
On Tue, Oct 1, 2024 at 5:31 PM Ben Scott @.***> wrote:
eslint-plugin-import is still working on ESLint v9 support.
There's nothing to do here - we're still waiting for our dependencies. Things have moved further along compared to July, but they're not there yet.
— Reply to this email directly, view it on GitHub https://github.com/Shopify/web-configs/issues/425#issuecomment-2387112879, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAHGK5GV6SGSV7W6EESA2WTZZMIE7AVCNFSM6AAAAABJBIWHGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBXGEYTEOBXHE . You are receiving this because you commented.Message ID: @.***>
Just heads up that the eslint-plugin-import now supports ESLint v9: https://github.com/import-js/eslint-plugin-import/releases/tag/v2.31.0
*nudgenudge
I've made a bunch of progress updating packages and fixing deprecations that should unblock ESLint v9 usage.
Other things are pulling my attention at the moment and I've not been able to complete testing (there's some fun where using import/no-cycle with flat config torpedos lint time that I've yet to get to the bottom of), so no ETA but some progress has been made.
I've made a bunch of progress updating packages and fixing deprecations that should unblock ESLint v9 usage.
Other things are pulling my attention at the moment and I've not been able to complete testing (there's some fun where using
import/no-cyclewith flat config torpedos lint time that I've yet to get to the bottom of), so no ETA but some progress has been made.
@BPScott also noticed this, though had a big speed up using the https://github.com/un-ts/eslint-plugin-import-x fork
@shopify/eslint-plugin v47 is released. This is a stage-setting release. I believe this fixes the majority of issues with ESLint v9 support, but I've not added v9 to the peerDependencies yet as I still need to test and confirm this in a real app first.
@BPScott any updates on your testing?
Also hoping for an update 🙏🏻
Just in case this is a useful anecdote for anyone holding off upgrading: I've been actively using eslint v9 with @shopify/eslint-plugin v48.0.2 for about a month now, and we haven't hit any snags that would make me recommend against it. Though, we are only using the typescript, typescript-type-checking and react configs, and we had quite a few of the slower rules already disabled/replaced with Biome equivalents (particularly import rules) so we possibly haven't noticed perf regressions in those if there are any. My advice to anyone considering upgrading would be to just go for it.
Finally shipped ESLint 9 support in v49.