web-configs icon indicating copy to clipboard operation
web-configs copied to clipboard

@shopify/eslint-plugin: Add support for ESLint v9 and flat config

Open EvgenyOrekhov opened this issue 1 year ago • 9 comments

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 Request label 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.
  • Is it related to a new package?

    • [ ] Tag it with the New package Label

Checklist

  • [ ] Please delete the labels section before submitting your issue
  • [ ] I have described this issue in a way that is actionable (if possible)

EvgenyOrekhov avatar Jun 09 '24 23:06 EvgenyOrekhov

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

andyw8 avatar Jul 05 '24 12:07 andyw8

https://github.com/Shopify/web/pull/135110 should help move this forward.

andyw8 avatar Jul 26 '24 16:07 andyw8

This should be solved by the latest release:

https://github.com/Shopify/web-configs/releases/tag/%40shopify%2Feslint-plugin%4046.0.0

andyw8 avatar Jul 31 '24 15:07 andyw8

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-plugin to 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".

BPScott avatar Jul 31 '24 15:07 BPScott

TypeScript ESLint v8 has been released https://github.com/typescript-eslint/typescript-eslint/releases/tag/v8.0.0

EvgenyOrekhov avatar Aug 01 '24 09:08 EvgenyOrekhov

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?

ryb73 avatar Oct 01 '24 19:10 ryb73

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.

BPScott avatar Oct 01 '24 21:10 BPScott

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: @.***>

ryb73 avatar Oct 01 '24 21:10 ryb73

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

adamxi avatar Oct 11 '24 07:10 adamxi

*nudgenudge

isaacbowen avatar Jan 08 '25 17:01 isaacbowen

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.

BPScott avatar Jan 08 '25 18:01 BPScott

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.

@BPScott also noticed this, though had a big speed up using the https://github.com/un-ts/eslint-plugin-import-x fork

timmevandermeer avatar Jan 17 '25 11:01 timmevandermeer

@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 avatar Jan 31 '25 17:01 BPScott

@BPScott any updates on your testing?

qqii avatar Apr 23 '25 19:04 qqii

Also hoping for an update 🙏🏻

ConduciveMammal avatar May 02 '25 13:05 ConduciveMammal

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.

bradchristensen avatar May 20 '25 05:05 bradchristensen

Finally shipped ESLint 9 support in v49.

BPScott avatar May 29 '25 16:05 BPScott