Skip to content

feat: add eslint v10 support#99

Closed
nicola-smartive wants to merge 1 commit into
mainfrom
feat/eslint-v10-support
Closed

feat: add eslint v10 support#99
nicola-smartive wants to merge 1 commit into
mainfrom
feat/eslint-v10-support

Conversation

@nicola-smartive
Copy link
Copy Markdown

  • 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:

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.

* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant