Skip to content

chore(web): lint findings to zero errors + CI lint gate - #116

Merged
okieselbach merged 2 commits into
mainfrom
chore/web-lint-cleanup
Jul 30, 2026
Merged

chore(web): lint findings to zero errors + CI lint gate#116
okieselbach merged 2 commits into
mainfrom
chore/web-lint-cleanup

Conversation

@okieselbach

Copy link
Copy Markdown
Owner

Summary

Stacked on #115merge #115 first, then this one (after #115 lands, the net diff of this PR is the lint changes only).

Package deal: fixes only land together with the CI gate, otherwise they drift right back. The CI web job now runs npm run lint -- --max-warnings 163: errors fail outright, the warning cap is a ratchet (lower it when fixing warnings, never raise it).

Fixed to zero (mechanical categories, behavior unchanged):

  • no-unused-vars (49): dead imports/locals removed; where a prop is part of a live call-site contract, only the destructured binding was dropped
  • no-explicit-any (29): real structural types for event payloads (EnrollmentEvent.data et al → Record<string, unknown> + per-event interfaces); SignalR passthroughs typed via the library''s own signatures
  • no-unescaped-entities (15), prefer-const, jsx-no-comment-textnodes
  • no-require-imports (5): scripts/**/*.js override — Node CJS scripts, require() is correct there
  • one stale eslint-disable directive removed

Deliberately NOT fixed inline: the React-Compiler hooks rules new in eslint-plugin-react-hooks v6 (set-state-in-effect 93, refs 26, static-components 14, purity 6, immutability 5, preserve-manual-memoization 3) are demoted to warn in eslint.config.mjs — each is a per-site behavioral refactor in auth/SignalR-adjacent code, to be burned down incrementally under the ratchet. No per-site eslint-disable allowed or added.

Verification

  • eslint: 0 errors / exactly 163 warnings; the CI gate command exits 0
  • tsc --noEmit clean, vitest 611/611, static export builds

🤖 Generated with Claude Code

okieselbach and others added 2 commits July 31, 2026 00:14
typedRoutes: true (stable in Next 16; `next typegen` already runs in CI
before tsc since #114). A typo'd <Link>/router.push target now fails the
build instead of 404ing at runtime — the failure class behind the recent
RSC/routing incidents.

- lib/routes.ts: registry helpers return `Route`; withQuery validates the
  base path literal. New: deviceBlockUrl (OpsEventsSection previously
  hand-built /admin/security/device-block against the registry rule),
  route() to compile-check dynamic-section literals (nav configs,
  section index redirects), trustedRoute() as the single named seam for
  runtime-data hrefs (backend-emitted notification deep links, persisted
  post-login return URL).
- Nav types (NavItem, ExpandableSubItem, PageSectionItem) carry Route
  hrefs — every sidebar/navbar entry is compile-checked.
- ClientRedirect is generic so dynamic-section literals infer.

Verified: tsc clean; negative test (typo'd static + dynamic routes)
fails compilation as intended; 611/611 vitest; static export builds
with an unchanged route list.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Package deal — fixes only land together with the gate, otherwise they
drift right back. CI web job now runs `eslint . --max-warnings 163`:
errors fail outright, the warning cap is a ratchet (lower it when fixing
warnings, never raise it).

Fixed to zero (mechanical categories, behavior unchanged):
- no-unused-vars (49): dead imports/locals removed; where a prop is part
  of a live call-site contract, only the destructured binding dropped
- no-explicit-any (29): real structural types for event payloads
  (EnrollmentEvent.data et al -> Record<string, unknown> + per-event
  interfaces), SignalR passthroughs typed via the library's own
  signatures; five consumer files got typing-only follow-through
- no-unescaped-entities (15), prefer-const, jsx-no-comment-textnodes
- no-require-imports (5): scripts/**/*.js override — Node CJS scripts,
  require() is correct there
- one stale eslint-disable directive removed

Deliberately NOT fixed inline: the React-Compiler hooks rules new in
eslint-plugin-react-hooks v6 (set-state-in-effect 93, refs 26,
static-components 14, purity 6, immutability 5,
preserve-manual-memoization 3) are demoted to warn in eslint.config.mjs —
each is a per-site behavioral refactor in auth/SignalR-adjacent code, to
be burned down incrementally under the ratchet.

Verified: eslint 0 errors / 163 warnings (gate command exits 0), tsc
clean, vitest 611/611, static export builds.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@okieselbach
okieselbach merged commit 72392f6 into main Jul 30, 2026
7 of 8 checks passed
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