Skip to content

deps: bump eslint from 9.39.5 to 10.11.0 in /frontend - #52

Merged
magicapple123 merged 1 commit into
mainfrom
deps/eslint-10
Oct 2, 2026
Merged

magicapple123 merged 1 commit into
mainfrom
deps/eslint-10

Conversation

@magicapple123

Copy link
Copy Markdown
Owner

Supersedes #46(Dependabot 只升了 eslint 本体、未配对升级插件链,Install 步骤死于 ERESOLVE;本 PR 做成组升级)。

成组升级清单(npm view peer 实测核对)

包 旧 新 peer 是否支持 eslint 10
eslint ^9.22.0 ^10.11.0 —(本体)
@eslint/js ^9.22.0 ^10.0.1 必须随 eslint 大版本配对
eslint-plugin-react-hooks ^5.2.0 ^7.1.1 ^3…^8 || ^9 || ^10 ✓
eslint-plugin-react-refresh ^0.5.7 不变 ^9 || ^10 ✓(已支持)
typescript-eslint ^8.71.0 不变 ^8.57.0 || ^9.0.0 || ^10.0.0 ✓(8.71.0 已支持)
globals ^16.0.0 不变 无 eslint peer ✓

eslint.config.js 调整(1 处,保持 lint 基线不变)

react-hooks v7 的 configs.recommended 默认启用了 Compiler 系新规则(set-state-in-effect / refs / use-memo / immutability / preserve-manual-memoization 等),在现有代码上产生 83 个新 error(70×set-state-in-effect、10×refs、4×use-memo、2×preserve-manual-memoization、1×immutability——npm run lint 实测分布)。这批规则对应 React Compiler 的优化前置检查,修复需要重构大量 effect 逻辑,超出依赖升级 PR 的范围。
因此本 PR 改为显式声明 v5 recommended 等价的两条经典规则:

  • react-hooks/rules-of-hooks: "error"
  • react-hooks/exhaustive-deps: "warn"

lint 输出与升级前完全一致:0 error / 11 warning(全部为存量)。Compiler 系规则的采用建议另开独立 PR 分批处理。

本地验证(Node 22.22.2,全新 npm install + rebase 后复验)

  • npm run test:123 files / 801 tests 全绿
  • npm run lint:0 errors(11 条存量 warning)
  • npm run typecheck:通过
  • npm run build(--outDir 仓库外):通过

@magicapple123
magicapple123 merged commit 587e959 into main Oct 2, 2026
10 checks passed
@magicapple123
magicapple123 deleted the deps/eslint-10 branch October 2, 2026 06:03
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