Skip to content

Fix ESLint v10 RuleContext API removal (follow-up to #3972)#3979

Open
ledsun wants to merge 2 commits intojsx-eslint:masterfrom
ledsun:update-deprecated-calls-v8
Open

Fix ESLint v10 RuleContext API removal (follow-up to #3972)#3979
ledsun wants to merge 2 commits intojsx-eslint:masterfrom
ledsun:update-deprecated-calls-v8

Conversation

@ledsun
Copy link
Copy Markdown

@ledsun ledsun commented Feb 9, 2026

This PR follows up on the feedback in the comments of #3972 and incorporates the requested changes.

I think this PR will fix #3977.

Copy link
Copy Markdown
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we'll need regression tests - it might be as simple as adding eslint 10 to the GHA matrix.

@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 11, 2026

Codecov Report

❌ Patch coverage is 49.49495% with 50 lines in your changes missing coverage. Please review.
✅ Project coverage is 97.26%. Comparing base (9af8845) to head (ea44283).

Files with missing lines Patch % Lines
lib/util/eslint.js 21.87% 50 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #3979      +/-   ##
==========================================
+ Coverage   94.76%   97.26%   +2.50%     
==========================================
  Files         134      137       +3     
  Lines       10165    10252      +87     
  Branches     3794     3833      +39     
==========================================
+ Hits         9633     9972     +339     
+ Misses        532      280     -252     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@ledsun ledsun marked this pull request as ready for review February 11, 2026 12:08
Comment thread lib/util/eslint.js Outdated
Comment thread lib/util/version.js Outdated
Comment thread lib/util/makeNoMethodSetStateRule.js
Comment thread .github/workflows/node-18+.yml Outdated
Comment thread lib/util/version.js Outdated
Comment thread package.json Outdated
Comment thread .github/workflows/eslint-9+.yml Outdated
Comment thread .github/workflows/eslint-8-.yml
Comment thread .github/workflows/eslint-9+.yml Outdated
@karlnorling
Copy link
Copy Markdown

@ledsun do you have time to address the failing checks. I'm looking at updating to eslint 10 and we're using the eslint-plugin-react

tylerbutler added a commit to microsoft/FluidFramework that referenced this pull request Apr 14, 2026
…-react/eslint-plugin (#27011)

## Summary

- Replace `eslint-plugin-react` (~7.37.5) with
`@eslint-react/eslint-plugin` (~2.13.0) in
`@fluidframework/eslint-config-fluid` to unblock ESLint 10 adoption
- Use the `recommended-typescript` preset which auto-disables rules
already handled by TypeScript
- Keep `eslint-plugin-react-hooks` separately — it already has ESLint 10
support and provides React Compiler rules
- Switch `print-configs` script from `tsx` to `jiti` to fix ESM-only
package resolution

### Why

`eslint-plugin-react` 7.37.5 is broken with ESLint 10 — it calls
`context.getFilename()` which was removed. The upstream fix
([jsx-eslint/eslint-plugin-react#3979](jsx-eslint/eslint-plugin-react#3979))
has been blocked since February 2026. `@eslint-react` v2.13.0 supports
ESLint 8/9/10, so this works now and won't block the ESLint 10 upgrade.

### Consumer updates

Per-package eslint config and package.json updates (rule renames,
removing redundant devDeps) will come in a follow-up PR stacked on this
one.

Resolves #27009
@charles4221 charles4221 linked an issue Apr 20, 2026 that may be closed by this pull request
9 tasks
@karlnorling
Copy link
Copy Markdown

What's the status on this PR? Do we need to open another one? Seems we're just waiting for CI to pass? @ljharb ?

@ljharb
Copy link
Copy Markdown
Member

ljharb commented Apr 28, 2026

Yes, it needs to be rebased and the test failures fixed. Please do NOT open a redundant PR; if you have changes you want added, comment with a branch or commit link, and I'll pull them in.

@modeitsch
Copy link
Copy Markdown

I checked this from a local checkout of 635cd2ce. It looks like the branch is not behind master anymore:

git rev-list --left-right --count origin/master...HEAD
# 0 2

gh pr checks 3979 --repo jsx-eslint/eslint-plugin-react is also green for the current head, including the ESLint 10 type-check jobs. If GitHub is still showing this as stale/failing somewhere, it may be cached PR metadata rather than an actual rebase/test failure.

@lorand-horvath
Copy link
Copy Markdown

I've pushed some of the commits from this PR to master, but it looks like we're blocked on import-js/eslint-plugin-import#3227.

@ljharb Is it still the case, i.e. blocked on eslint-plugin-import?

JonasBruun added a commit to BeCauseEco/components that referenced this pull request Apr 30, 2026
Two upstream incompatibilities prevented lint from running:

- eslint-config-next bundles typescript-eslint@8.48 whose
  @typescript-eslint/utils still does `class FlatESLint extends
  use_at_your_own_risk.FlatESLint` directly. ESLint 10 removed
  FlatESLint so this crashes on require. 8.59+ falls back to
  ESLint when FlatESLint is undefined. Forced via resolutions.

- eslint-plugin-react's React-version auto-detection calls
  context.getFilename(), removed in ESLint 10. Workaround per
  vercel/next.js#89764: hardcode the React version in settings.

Both workarounds are commented inline with the upstream tracking
links so they can be removed once eslint-config-next ships with
typescript-eslint >= 8.49 and eslint-plugin-react ships
jsx-eslint/eslint-plugin-react#3979.

With lint actually running, three pre-existing no-useless-assignment
errors surfaced in DataTable.tsx and FeaturesClusterMarker.tsx
(let foo = <default> followed by a fully-covering if/else chain).
Fixed by dropping the dead initial assignment.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dan2kx

This comment was marked as resolved.

@ljharb

This comment was marked as resolved.

@lorand-horvath
Copy link
Copy Markdown

Would it be an option to move to an eslint 10 compatible plugin like eslint-plugin-import-x?

No.

@ljharb Why not? It's not like this one is compatible with eslint 10 or something. When will it be fixed?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Upgrade to ESLint v10 ESLint v10 compatibility