r/reactjs • • 10h ago

Upgrading to ESLint 10 with eslint-plugin-react: why it passes locally and fails in CI, and a fix

If you've tried ESLint 10 with eslint-plugin-react, jsx-a11y or import, you've probably hit ERESOLVE or getFilename is not a function. None of the three has released ESLint 10 support yet.

What I found:

  • npm install -D eslint@10 in an existing project only warns, so it looks fine. npm ci in CI then fails.
  • The crash comes from settings.react.version: "detect" calling a function ESLint 10 remove

The manual fix is an npm overrides entry per plugin plus wrapping your config in fixupConfigRules from u/eslint/compat (details in the README).

I wrote a CLI that does it and proves your lint output didn't change: npx eslint-unstick --fix.

Repo: https://github.com/Raj-json/eslint-unstick. Feedback from real projects is very welcome, especially where it fails.

0 Upvotes

10 comments sorted by

3

u/power78 9h ago

Forget eslint. Biome and oxlint are the future. Way, way faster.

0

u/angusmiguel 8h ago

Not as configurable yet..

1

u/power78 1h ago

What can't biome do?

1

u/angusmiguel 1h ago

Afaik custom linting rules, donest work super well with tracking react dep arrays

1

u/power78 39m ago

I've found it does quite well with that. We migrated our extremely large config to biome and were able to get everything done with it. We also have some custom rules that worked 100%.

1

u/Weak_Particular_5799 6h ago

fwiw on ESLint 10.16 with eslint-plugin-react 7.37.5, just pinning settings.react.version to a real number ("19.2") instead of "detect" got the whole recommended config running for me, no compat wrapper. fixupConfigRules was only needed for a few non-recommended rules like jsx-tag-spacing, jsx-filename-extension and jsx-one-expression-per-line, those still crash.

1

u/allaboutzaid 4h ago

This is the kind of thing that worries me about upgrading tooling on my small projects — it passing locally and only failing in CI is exactly the trap I'd fall into, since my lint runs in GitHub Actions too. The tip in the comments about pinning settings.react.version to a real number instead of "detect" sounds like the simpler fix for a small project — is that the route you'd take before reaching for the CLI, or does the CLI catch things the pin doesn't?