Fix ESLint v10 RuleContext API removal (follow-up to #3972)#3979
Fix ESLint v10 RuleContext API removal (follow-up to #3972)#3979ledsun wants to merge 2 commits intojsx-eslint:masterfrom
Conversation
ljharb
left a comment
There was a problem hiding this comment.
we'll need regression tests - it might be as simple as adding eslint 10 to the GHA matrix.
f987ffa to
a7b967b
Compare
Codecov Report❌ Patch coverage is
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. 🚀 New features to boost your workflow:
|
6a95ab9 to
13c7805
Compare
|
@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 |
|
@ljharb all checks are passing now. Upon reviewing the code, I found additional areas that needed fixes in the helper for test code and in |
- 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
* 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>
|
@ljharb hello, any news on this PR? |
2648f5b to
d309eb0
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
0802ab4 to
635cd2c
Compare
|
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. |
## 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>
ijstokes
left a comment
There was a problem hiding this comment.
Skimmed code, detailed review of PR text, tested in UI. Works well. Accepting.
…-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
This PR follows up on the feedback in the comments of #3972 and incorporates the requested changes.
I think this PR will fix #3977.