Skip to content

chore(lint): clean up 113 ESLint errors -> 0#13

Merged
chriskehayias merged 1 commit into
mainfrom
chore/lint-cleanup
May 20, 2026
Merged

chore(lint): clean up 113 ESLint errors -> 0#13
chriskehayias merged 1 commit into
mainfrom
chore/lint-cleanup

Conversation

@chriskehayias
Copy link
Copy Markdown
Contributor

Summary

Resolves all ESLint errors and warnings surfaced after the dependency update bumped eslint-config-next to 16.2.6 (which introduced React Compiler-aware hooks rules and stricter no-unused-vars defaults).

Before: 113 errors, 8 warnings
After: 0 errors, 0 warnings

eslint.config.mjs changes

  • Ignore coverage/** (auto-generated)
  • Allow ^_ prefix for no-unused-vars (standard discard idiom: const { [k]: _, ...rest } = obj)
  • Test-file override (**/*.test.{ts,tsx}) turns off no-explicit-any and no-require-imports — Vitest mock patterns rely on (mockFn as any).mockResolvedValueOnce(...) and would otherwise require touching ~95 lines across service test files

Real correctness fix

  • add-edit-family.tsx — moved loadHousehold useCallback above the useEffect that 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

  • Removed unused imports/vars in add-edit-family.tsx, imb-barcode.tsx, barcode-image.ts, word-document.ts
  • eslint --fix stripped redundant eslint-disable directives from 5 test files

Targeted disables (with reason comments)

For legitimate patterns the new react-hooks/set-state-in-effect and preserve-manual-memoization rules flag:

  • SSR hydration gates (setMounted(true) after first mount)
  • Loading/error flags before async work (no reducer in place)
  • Editor ↔ dialog state sync on open
  • 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 an existing comment already explains why

Each disable is scoped to one line with a brief reason — not blanket file-level suppressions.

Test plan

  • npm run lint → 0 errors, 0 warnings
  • npm run test:run → 647/647 passing
  • Smoke test the affected UI paths after merge: address labels, dev panel mount, template editor code/export dialogs, signin redirect, add/edit family load-by-contact

🤖 Generated with Claude Code

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>
@chriskehayias chriskehayias merged commit 3343f0d into main May 20, 2026
1 check passed
@chriskehayias chriskehayias deleted the chore/lint-cleanup branch May 20, 2026 15:11
@codecov
Copy link
Copy Markdown

codecov Bot commented May 20, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

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