Skip to content

chore: upgrade ESLint 9 to 10 with plugin updates#223

Merged
neonwatty merged 2 commits intomainfrom
chore/eslint-v10-migration
Mar 12, 2026
Merged

chore: upgrade ESLint 9 to 10 with plugin updates#223
neonwatty merged 2 commits intomainfrom
chore/eslint-v10-migration

Conversation

@neonwatty
Copy link
Copy Markdown
Collaborator

Summary

  • Upgrades ESLint from v9 to v10 and all ESLint plugins to their latest versions
  • Fixes 7 new lint errors introduced by eslint-plugin-react-hooks v7's stricter rules
  • Adds @testing-library/dom as explicit dev dependency (previously resolved as transitive)

Package Updates

Package From To
eslint 9.39.3 10.0.3
eslint-plugin-react-hooks 5.2.0 7.0.1
eslint-plugin-react-refresh 0.4.20 0.5.2
eslint-plugin-security 3.0.1 4.0.0
@typescript-eslint/eslint-plugin 8.33.0 8.57.0
@typescript-eslint/parser 8.33.0 8.57.0

Lint Error Fixes

React Hooks v7 introduces two new rules (set-state-in-effect, ref-access-in-render). All 7 violations fixed:

File Rule Fix
CookieConsent.tsx set-state-in-effect useState initializer instead of mount effect
WelcomeModal.tsx set-state-in-effect useState initializer instead of mount effect
VerificationSuccessBanner.tsx set-state-in-effect useState initializer from search params
IOSDateTimePicker.tsx set-state-in-effect Moved state init to handleOpen event handler
NudgeBanner.tsx set-state-in-effect Derived loading state + .then() for async setState
theme.tsx set-state-in-effect useMemo for derived resolvedTheme
useAutoSave.ts ref-access-in-render Moved ref assignment to useEffect

Notes

  • eslint-plugin-react-hooks@7.0.1 declares peer deps up to ESLint 9, but works at runtime with ESLint 10. ESLint 10 support is merged but unreleased. Installed with --legacy-peer-deps.

Test plan

  • npx eslint . — 0 errors, 399 warnings (all pre-existing)
  • npx tsc --noEmit — passes
  • npx next build — succeeds
  • npx vitest run — 78/78 test files, 1028/1028 tests pass

@vercel
Copy link
Copy Markdown

vercel bot commented Mar 12, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
bullhorn Ready Ready Preview, Comment Mar 12, 2026 3:58pm

Request Review

- eslint 9.39.3 → 10.0.3
- eslint-plugin-react-hooks 5.2.0 → 7.0.1
- eslint-plugin-react-refresh 0.4.20 → 0.5.2
- eslint-plugin-security 3.0.1 → 4.0.0
- @typescript-eslint/eslint-plugin 8.33.0 → 8.57.0
- @typescript-eslint/parser 8.33.0 → 8.57.0

Fix 7 new lint errors from react-hooks v7 rules:
- set-state-in-effect: use useState initializers for mount-only
  localStorage/URL reads (CookieConsent, WelcomeModal,
  VerificationSuccessBanner)
- set-state-in-effect: derive resolvedTheme via useMemo instead
  of syncing via effect (theme.tsx)
- set-state-in-effect: move temp state init to event handler
  (IOSDateTimePicker)
- set-state-in-effect: replace loading state with derived value
  (NudgeBanner)
- ref-access-in-render: move ref assignment to useEffect
  (useAutoSave)
- Add .npmrc with legacy-peer-deps=true so npm ci succeeds in CI
  (eslint-plugin-react-hooks@7.0.1 peer deps don't include ESLint 10 yet)
- Fix knip config for knip 5.86: add types rule off, remove stale
  ignore entries that newer knip handles automatically
@neonwatty neonwatty force-pushed the chore/eslint-v10-migration branch from bb97f70 to c077a20 Compare March 12, 2026 15:56
@neonwatty neonwatty merged commit a979f80 into main Mar 12, 2026
10 checks passed
@neonwatty neonwatty deleted the chore/eslint-v10-migration branch March 12, 2026 16:36
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