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

@ledsun
Copy link
Copy Markdown
Author

ledsun commented Mar 17, 2026

@ljharb all checks are passing now.
Please take another look when you have a moment.

Upon reviewing the code, I found additional areas that needed fixes in the helper for test code and in tests/lib/rules/jsx-no-undef.js. I have split each fix into separate commits and included comments.

vschoener added a commit to vschoener/front.vincelivemix that referenced this pull request Mar 22, 2026
- pnpm override: ledsun/eslint-plugin-react#2648f5b (jsx-eslint/eslint-plugin-react#3979)
- Renovate: disable automerge for eslint major updates (devDeps rule was too broad)

Made-with: Cursor
vschoener added a commit to vschoener/front.vincelivemix that referenced this pull request Mar 22, 2026
* chore(deps): update dependency eslint to v10

* fix(deps): pin eslint-plugin-react for ESLint 10 until upstream release

- pnpm override: ledsun/eslint-plugin-react#2648f5b (jsx-eslint/eslint-plugin-react#3979)
- Renovate: disable automerge for eslint major updates (devDeps rule was too broad)

Made-with: Cursor

---------

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: Vincent Schoener <1213200+vschoener@users.noreply.github.com>
@Guymestef
Copy link
Copy Markdown

@ljharb hello, any news on this PR?

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 29, 2026

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addedeslint@​10.1.08910010096100

View full report

@ljharb ljharb force-pushed the update-deprecated-calls-v8 branch 2 times, most recently from 0802ab4 to 635cd2c Compare April 1, 2026 03:19
@ljharb
Copy link
Copy Markdown
Member

ljharb commented Apr 1, 2026

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.

KinjiKawaguchi added a commit to su-its/typing that referenced this pull request Apr 10, 2026
## Why

依存アップグレード(Next.js 16 / React 19 / ESLint 9 フラットコンフィグ等)で `yarn build` /
`yarn lint` / CI インストールが壊れていたので、ビルドチェーンを再び通るようにする。併せて調査中に判明した Tailwind /
shadcn スタック一式や、役目を終えた依存の残骸も掃除する。

## What

### Next.js 16 / ESLint 9 アップグレード対応

- `next lint` 廃止に伴う ESLint フラットコンフィグ移行(`eslint.config.mjs`)
- Next.js 16 の purity lint / set-state-in-effect ルールに合わせた
`GameTyping.tsx` / `RankingTabs.tsx` / `game/page.tsx` の修正
- `tsconfig.json` を Next.js の自動補正(`jsx: react-jsx` /
`.next/dev/types/**` の include 追加)に追従

### Tailwind / shadcn スタック撤去

実態として `@tailwind` ディレクティブも Tailwind
ユーティリティクラスも使われていないため、関連パッケージ・設定ファイルを一式削除:

- **dependencies** 削除: `clsx`, `tailwind-merge`, `tailwindcss-animate`,
`@radix-ui/react-slot`, `@radix-ui/react-toast`,
`class-variance-authority`, `lucide-react`
- **devDependencies** 削除: `tailwindcss`, `@tailwindcss/postcss`,
`postcss`, `autoprefixer`
- **ファイル削除**: `tailwind.config.ts`, `postcss.config.js`,
`src/libs/shadcn/`
- autoprefixing は Next.js 組み込みの PostCSS パイプライン(`postcss-preset-env`)に委譲

### 依存整備

- `@testing-library/react` の peer 要件である `@testing-library/dom` を明示追加
- `prettier` を `dependencies` → `devDependencies` に分類修正
- `@types/node` / `eslint` / `prettier` / `tsx` の patch / minor 追従
- `@next/codemod` が自動挿入した `@types/react` / `@types/react-dom` の
`resolutions` ブロックを削除(React 19 エコシステム成熟により不要、むしろ古い `19.0.1` / `19.0.2`
に固定される副作用が出ていた)
- `openapi-typescript` v6 → v7 bump に合わせて `v1.d.ts` を v7 format で再生成
- `RankingTabs.tsx` の未使用 `useCallback` import 削除
- Yarn 4(Corepack)で `yarn.lock` をクリーン再生成

## How

- `tsconfig.json` の差分(`jsx` 変更・include 追加)は Next.js 16 が `next build`
時に自動で書き戻すもので、手動の設計変更ではない。ログ上も `jsx was set to react-jsx (next.js uses
the React automatic runtime)` として明示される。
- `postcss.config.js` を削除することで Next.js 組み込みの PostCSS
デフォルトにフォールバックする構成。最終出力 CSS(ベンダープレフィックス等)は従前と同じ。
- ESLint は `^9.39.4` 固定(v10 非対応): `eslint-plugin-react` が ESLint v10
で削除されたレガシー API(`context.getFilename()`)に依存しているため、上流修正
([jsx-eslint/eslint-plugin-react#3979](jsx-eslint/eslint-plugin-react#3979))
が公開されるまで v9 に留める。参考:
[vercel/next.js#89764](vercel/next.js#89764)
- lint は 0 errors(既存の `<img>` 6 件と 1 件の `react-hooks/exhaustive-deps`
警告のみ残る。いずれも今回のスコープ外)

## Validation

- `corepack yarn install --immutable`
- `corepack yarn format:ci`
- `corepack yarn lint`
- `corepack yarn build`
- `corepack yarn test --runInBand`

## References

- [Next.js 16 upgrade
guide](https://nextjs.org/docs/app/guides/upgrading/version-16)
- [Next.js ESLint migration / flat
config](https://nextjs.org/docs/app/api-reference/config/eslint)
- [Next.js
codemods](https://nextjs.org/docs/app/guides/upgrading/codemods)
- [Tailwind CSS v4 upgrade
guide](https://tailwindcss.com/docs/upgrade-guide)
- [vercel/next.js#89764 — ESLint v10
incompatibility](vercel/next.js#89764)

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

@ijstokes ijstokes left a comment

Choose a reason for hiding this comment

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

Skimmed code, detailed review of PR text, tested in UI. Works well. Accepting.

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

8 participants