Skip to content

chore(deps): upgrade eslint to v10#47

Merged
tznthou merged 1 commit into
mainfrom
chore/eslint-v10
May 29, 2026
Merged

chore(deps): upgrade eslint to v10#47
tznthou merged 1 commit into
mainfrom
chore/eslint-v10

Conversation

@tznthou
Copy link
Copy Markdown
Owner

@tznthou tznthou commented May 29, 2026

摘要

升級 eslint v9 → v10 生態,Renovate 第二波第二輪的綠燈項目之一。

改動

  • eslint ^9.39.4 → ^10.4.0、@eslint/js → ^10.0.1
  • eslint-plugin-react-hooks ^7.0.1 → ^7.1.1(eslint 10 peer 要求,連帶升避免 peer conflict)
  • 新增宣告 globals:eslint 10 不再 transitive 帶入,修正 eslint.config.mjs 的 phantom import

eslint 10 / react-hooks 7.1.1 新規則處置(11 處)

逐處讀懂脈絡後分類:

  • 2× no-useless-assignment:Font/Theme switcher 的 let nextIndex = currentIndex 是 dead code(switch 各 case 覆寫、default return),改 let nextIndex: number
  • 1× DashboardPage:setLoading(true) 移進 async IIFE,行為等價、規避 set-state-in-effect
  • 8× justified eslint-disable:合法 React pattern(latest-ref、ref-as-cache、reset-on-prop、mount-fetch),每處註明理由。renderer 無 component test 接住,不在 deps 升級 PR 做有風險的邏輯重構

驗證

  • ✅ install peer 無衝突
  • ✅ lint 綠(11 處全解決)
  • ✅ root + web strict typecheck 綠
  • ✅ 469 tests 全綠

🤖 Generated with Claude Code

- eslint ^9.39.4 -> ^10.4.0, @eslint/js -> ^10.0.1
- eslint-plugin-react-hooks ^7.0.1 -> ^7.1.1 (eslint 10 peer requirement)
- declare globals explicitly: eslint 10 no longer pulls it transitively,
  fixing a phantom import in eslint.config.mjs

Resolve 11 issues surfaced by eslint 10 / react-hooks 7.1.1 new rules:
- 2x no-useless-assignment: drop dead initial assignment in Font/Theme switchers
- 1x DashboardPage: move setLoading(true) into async IIFE (behavior-equivalent)
- 8x justified eslint-disable for legitimate React patterns (latest-ref,
  ref-as-cache, reset-on-prop, mount-fetch); renderer has no component-test
  harness, so avoid risky refactors of working code

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@tznthou tznthou merged commit e262293 into main May 29, 2026
4 checks passed
@tznthou tznthou deleted the chore/eslint-v10 branch May 29, 2026 01:51
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