chore(lint): clean up 113 ESLint errors -> 0#13
Merged
Conversation
Resolves all lint errors and warnings surfaced after the dependency
update bumped eslint-config-next to 16.2.6 (which introduced
React Compiler-aware hooks rules and the stricter no-unused-vars
defaults).
eslint.config.mjs:
- Ignore coverage/** (auto-generated coverage reports)
- Allow ^_ prefix for no-unused-vars (standard discard idiom for
destructure-and-drop, e.g. const { [k]: _, ...rest } = obj)
- Test-file override (**/*.test.ts(x)) turns off no-explicit-any and
no-require-imports — Vitest mocking patterns rely on (mockFn as any)
and these are widely scoped across all service test files
Real correctness fix:
- add-edit-family.tsx: move loadHousehold useCallback above the
useEffect that calls it. The React Compiler-aware linter correctly
flagged the previous ordering (useEffect at L112 calling a callback
declared at L120) as a real hazard.
Cleanup:
- Remove unused imports/vars in add-edit-family.tsx, imb-barcode.tsx,
barcode-image.ts, word-document.ts
- eslint --fix stripped redundant disable directives from 5 test files
Targeted eslint-disable-next-line comments (with reason) for legitimate
patterns the new react-hooks rules flag as anti-patterns:
- SSR hydration gates (setMounted(true) after first mount)
- Loading/error flags before async work
- Editor <-> dialog state sync when an editor dialog opens
- Debounce-then-reset autocomplete predictions
- React Compiler false positive on preserve-manual-memoization
(inferred dep mismatch on stable setState identity)
- Intentional partial useCallback deps where a comment already
explains why a subset of object keys is used
Validation:
- npm run lint -> 0 errors, 0 warnings (was 113 errors / 8 warnings)
- npm run test:run -> 647/647 passing
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
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
Resolves all ESLint errors and warnings surfaced after the dependency update bumped
eslint-config-nextto 16.2.6 (which introduced React Compiler-aware hooks rules and stricterno-unused-varsdefaults).Before: 113 errors, 8 warnings
After: 0 errors, 0 warnings
eslint.config.mjschangescoverage/**(auto-generated)^_prefix forno-unused-vars(standard discard idiom:const { [k]: _, ...rest } = obj)**/*.test.{ts,tsx}) turns offno-explicit-anyandno-require-imports— Vitest mock patterns rely on(mockFn as any).mockResolvedValueOnce(...)and would otherwise require touching ~95 lines across service test filesReal correctness fix
add-edit-family.tsx— movedloadHouseholduseCallbackabove theuseEffectthat calls it. The React Compiler-aware linter correctly flagged the previous ordering (effect at L112 calling a callback declared at L120) as a real hazard.Cleanup
add-edit-family.tsx,imb-barcode.tsx,barcode-image.ts,word-document.tseslint --fixstripped redundanteslint-disabledirectives from 5 test filesTargeted disables (with reason comments)
For legitimate patterns the new
react-hooks/set-state-in-effectandpreserve-manual-memoizationrules flag:setMounted(true)after first mount)preserve-manual-memoization(inferred dep mismatch on stable setState identity)useCallbackdeps where an existing comment already explains whyEach disable is scoped to one line with a brief reason — not blanket file-level suppressions.
Test plan
npm run lint→ 0 errors, 0 warningsnpm run test:run→ 647/647 passing🤖 Generated with Claude Code