chore: upgrade ESLint 9 to 10 with plugin updates#223
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
- 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
bb97f70 to
c077a20
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eslint-plugin-react-hooksv7's stricter rules@testing-library/domas explicit dev dependency (previously resolved as transitive)Package Updates
eslinteslint-plugin-react-hookseslint-plugin-react-refresheslint-plugin-security@typescript-eslint/eslint-plugin@typescript-eslint/parserLint Error Fixes
React Hooks v7 introduces two new rules (
set-state-in-effect,ref-access-in-render). All 7 violations fixed:CookieConsent.tsxset-state-in-effectuseStateinitializer instead of mount effectWelcomeModal.tsxset-state-in-effectuseStateinitializer instead of mount effectVerificationSuccessBanner.tsxset-state-in-effectuseStateinitializer from search paramsIOSDateTimePicker.tsxset-state-in-effecthandleOpenevent handlerNudgeBanner.tsxset-state-in-effect.then()for async setStatetheme.tsxset-state-in-effectuseMemofor derivedresolvedThemeuseAutoSave.tsref-access-in-renderuseEffectNotes
eslint-plugin-react-hooks@7.0.1declares 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— passesnpx next build— succeedsnpx vitest run— 78/78 test files, 1028/1028 tests pass