Skip to content

chore(web): cut lint warnings 171 → 56#178

Open
c0dewhacker wants to merge 1 commit into
mainfrom
chore/lint-cleanup
Open

chore(web): cut lint warnings 171 → 56#178
c0dewhacker wants to merge 1 commit into
mainfrom
chore/lint-cleanup

Conversation

@c0dewhacker
Copy link
Copy Markdown
Owner

Reduces web lint warnings from 171 → 56 (−67%) with no behaviour change. Typecheck and lint pass (0 errors).

Config-level suppressions (defensible)

  • components/ui/** (vendored shadcn) — disable @eslint-react/no-forward-ref + react-refresh/only-export-components. These are generated primitives following upstream's React.forwardRef + colocated-variant-const pattern; forking 30+ files away from their source is worse than the warning. −60
  • react-hooks/incompatible-library — known false positive against react-hook-form's watch()/control API (the library is React-compatible). −6
  • @eslint-react/set-state-in-effect — the same rule as react-hooks/set-state-in-effect, which the config already disables with a documented rationale ("pattern is valid in controlled sync effects"). Turned off the twin for consistency. −41

Real fixes (no behaviour change)

  • BuildingDetailAdminPage: dropped gratuitous (floor as any) casts — floorPlan is already on the Floor type; widened the prop with _count.
  • FloorAdminPage / ReportsAdminPage: typed building access and added buildingName/buildingId to UtilisationDataPoint.

Left as warnings on purpose (genuine signal — not suppressed)

Rule Count Why kept
@eslint-react/purity 11 Real new Date() / matchMedia calls during render
@eslint-react/exhaustive-deps 3 Possible stale-closure bugs — need per-site judgement
@eslint-react/no-array-index-key 24 Mostly benign but fixable incrementally
@eslint-react/use-state 13 Lazy-init micro-perf suggestions
@typescript-eslint/no-explicit-any 2 In UsersAdminPage — these mask a real 'SUSPENDED' vs ACTIVE|BLOCKED status mismatch that deserves its own fix, not a lint pave-over

Test plan

  • tsc --noEmit (web) — clean
  • eslint src — 0 errors, 56 warnings (was 171)

Config (defensible suppressions):
- components/ui/** (vendored shadcn): disable no-forward-ref + only-export-components
  rather than forking 30+ primitives from upstream (−60)
- react-hooks/incompatible-library: known false positive vs react-hook-form (−6)
- @eslint-react/set-state-in-effect: same rule as react-hooks/set-state-in-effect,
  already disabled with a documented rationale — turn off the twin for consistency (−41)

Real fixes (no behaviour change):
- BuildingDetail: drop gratuitous (floor as any) casts; floorPlan is already typed,
  widen prop with _count
- Floor/Reports: type building + add buildingName to UtilisationDataPoint

Left as warnings (genuine signal): purity (new Date()/matchMedia in render),
exhaustive-deps (possible stale closures), no-array-index-key, use-state lazy-init,
and 2 no-explicit-any in UsersAdminPage that mask a real 'SUSPENDED' status bug.
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