feat: add eslint v10 support#99
Closed
nicola-smartive wants to merge 1 commit into
Closed
Conversation
* Relax peer `eslint` to `^9.22.0 || ^10.0.0` and bump dev `eslint`
→ 10.3.0 / `@eslint/js` → 10.0.1.
* Bump `@typescript-eslint/*` to `^8.59.2` (declares eslint v10 peer)
and `eslint-plugin-react-hooks` to `^7.1.1` (declares eslint v10
peer).
* Tighten engines to `^20.19.0 || ^22.13.0 || >=24` to match eslint
v10's `engines.node`.
* Restructure configs.ts for eslint v10's stricter plugin-rule
validation:
- Split `typescriptRules` into a new `tsBaseConfig` block scoped
to `**/*.{ts,tsx,mts,cts}`, where the `@typescript-eslint`
plugin is actually registered.
- Scope the `flatConfigNext` rules-only block and `reactConfig`
to the same file globs.
- Explicitly register `@typescript-eslint` plugin in
`flatConfigNext` since `eslint-config-next` only registers it
for `**/*.{ts,tsx}` — rules referenced elsewhere now resolve.
* Add `overrides` to satisfy outdated v9-capped peer ranges of
`eslint-plugin-import` (^2.32.0, peer caps at eslint v9) and
`eslint-plugin-react` (^7.37.5, peer caps at eslint v9.7), both
of which still work at install time once the peer is overridden.
Blocked at runtime — DOES NOT make consuming projects pass
`eslint` against v10 yet:
* `eslint-plugin-react@7.37.5` (latest) still calls removed eslint
v9 context APIs (`context.getFilename()` /
`context.getSourceCode()`) in three spots that bypass the
plugin's own compat helpers:
- `lib/util/version.js:31`
- `lib/rules/jsx-filename-extension.js:64`
- `lib/rules/forward-ref-uses-ref.js:60`
Upstream fix is jsx-eslint/eslint-plugin-react#3979 (open since
Feb 2026, stalled on contributor inactivity). Tracking issue:
jsx-eslint/eslint-plugin-react#3977 (248+ 👍).
* `eslint-config-next` (incl. canaries) still depends on the
broken `eslint-plugin-react@^7.37.0` and Vercel has explicitly
deferred their own switch in favour of waiting for upstream —
see vercel/next.js#89764 and the closed-without-merge attempt
in vercel/next.js#91710.
Consumers upgrading to eslint v10 today need a `patch-package`
shim over `eslint-plugin-react` (≈3 lines) until upstream lands.
This package is ready for v10 but is gated by that upstream fix.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
eslintto^9.22.0 || ^10.0.0and bump deveslint→ 10.3.0 /@eslint/js→ 10.0.1.@typescript-eslint/*to^8.59.2(declares eslint v10 peer) andeslint-plugin-react-hooksto^7.1.1(declares eslint v10 peer).^20.19.0 || ^22.13.0 || >=24to match eslint v10'sengines.node.typescriptRulesinto a newtsBaseConfigblock scoped to**/*.{ts,tsx,mts,cts}, where the@typescript-eslintplugin is actually registered.flatConfigNextrules-only block andreactConfigto the same file globs.@typescript-eslintplugin inflatConfigNextsinceeslint-config-nextonly registers it for**/*.{ts,tsx}— rules referenced elsewhere now resolve.overridesto satisfy outdated v9-capped peer ranges ofeslint-plugin-import(^2.32.0, peer caps at eslint v9) andeslint-plugin-react(^7.37.5, peer caps at eslint v9.7), both of which still work at install time once the peer is overridden.Blocked at runtime — DOES NOT make consuming projects pass
eslintagainst v10 yet:eslint-plugin-react@7.37.5(latest) still calls removed eslint v9 context APIs (context.getFilename()/context.getSourceCode()) in three spots that bypass the plugin's own compat helpers:lib/util/version.js:31lib/rules/jsx-filename-extension.js:64lib/rules/forward-ref-uses-ref.js:60Upstream fix is Fix ESLint v10 RuleContext API removal (follow-up to #3972) jsx-eslint/eslint-plugin-react#3979 (open since Feb 2026, stalled on contributor inactivity). Tracking issue: ESLint v10 compatibility jsx-eslint/eslint-plugin-react#3977 (248+ 👍).eslint-config-next(incl. canaries) still depends on the brokeneslint-plugin-react@^7.37.0and Vercel has explicitly deferred their own switch in favour of waiting for upstream — see [ESLint v10]: TypeError: contextOrFilename.getFilename is not a function when running ESLint v10 vercel/next.js#89764 and the closed-without-merge attempt in fix : add ESLint v10 support to eslint-config-next vercel/next.js#91710.Consumers upgrading to eslint v10 today need a
patch-packageshim overeslint-plugin-react(≈3 lines) until upstream lands. This package is ready for v10 but is gated by that upstream fix.