Skip to content

chore(lint): make the repo lint-clean and add a CI Lint job (#25)#5

Merged
iaj6 merged 2 commits into
mainfrom
fix/lint-ci-cleanup
Jun 4, 2026
Merged

chore(lint): make the repo lint-clean and add a CI Lint job (#25)#5
iaj6 merged 2 commits into
mainfrom
fix/lint-ci-cleanup

Conversation

@iaj6

@iaj6 iaj6 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Summary

Completes the lint half of #25 (the e2e half shipped in #4). Makes the whole repo lint-clean and adds a CI Lint job. Targets main (PRs #1#4 are merged).

Web: 11 errors + 11 warnings → 0 / 0

The React-Compiler / react-hooks errors were fixed behavior-preservingly (each traced against callers + the adversarial review):

File Rule Fix
SessionsTable static-components Hoisted inline SortIcon to module scope; pass sortBy/sortDir as props
SessionDetail set-state-in-effect Lazy-init loading from runIds.length instead of setState in the effect
WebhooksSection set-state-in-effect Inlined on-mount load into the effect with a cancelled guard; kept loadList() for refreshes
page.tsx purity Scoped eslint-disable — it's a server component, Date.now() per-request is correct
useEventSource immutability Scoped eslint-disable — the self-referencing reconnect timer is runtime-safe

Plus: RunsTable gained a missing searchParams dep on a useCallback (fixes a real stale-closure bug); unused imports/vars removed; apostrophes escaped; require()import in two test helpers.

Other packages

A shared eslint.config.base.mjs (typescript-eslint recommended, light: no-explicit-any off, unused-vars/require as warn) re-exported by core/db/cli/sdk — each error-free (advisory warnings remain). No new deps: typescript-eslint resolves via workspace hoisting (transitive of web's eslint-config-next), documented inline.

CI

New Lint job runs npm run lint (fails on errors only). lint scripts added per package + at root.

Verification

Full build clean; 1166 tests pass; npm run lint exits 0 across the monorepo. Adversarial review (3 reviewers + synthesis): ship-with-nits, 0 blockers — independently confirmed all UI refactors are behavior-preserving and the CI lint resolves after npm ci.

Follow-up (own PR)

Declare eslint + typescript-eslint as explicit root devDependencies rather than relying on hoisting — deferred because it requires regenerating package-lock.json (the documented macOS→Linux optional-deps procedure). Not a current CI break.

🤖 Generated with Claude Code

iaj6 and others added 2 commits June 3, 2026 17:22
Completes the deferred lint half of review finding #25.

Web (had 11 errors + 11 warnings → now 0/0):
- React-Compiler / react-hooks errors fixed behavior-preservingly:
  - SessionsTable: hoist the inline SortIcon to module scope, pass
    sortBy/sortDir as props (react-hooks/static-components).
  - SessionDetail: lazy-init `loading` from runIds.length instead of
    setState-in-effect (react-hooks/set-state-in-effect).
  - WebhooksSection: inline the on-mount load into the effect with a
    cancelled-guard; keep loadList() for refreshes.
  - page.tsx (server component) + useEventSource self-referencing
    reconnect timer: scoped eslint-disable with justification (both are
    rule false-positives — server render / runtime-safe self-reference).
- RunsTable: add the missing `searchParams` dep to a useCallback (fixes a
  real stale-closure bug); drop unused imports.
- Mechanical: remove unused imports/vars, escape apostrophes, convert
  require() to import in the tokens/users tests.

Other packages: a shared eslint.config.base.mjs (typescript-eslint
recommended, light: any off, unused-vars + require as warn) is re-exported
by core/db/cli/sdk; each is error-free. typescript-eslint resolves via
workspace hoisting (transitive of web's eslint-config-next) — documented.

Wiring: `lint` scripts per package + at root; CI gains a Lint job
(npm run lint, fails on errors only). Full build clean; 1166 tests pass;
npm run lint exits 0. Adversarially reviewed (ship-with-nits, 0 blockers).

Follow-up (own PR): declare eslint + typescript-eslint as explicit root
devDependencies (needs a package-lock regeneration).

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
@iaj6 iaj6 merged commit 4ed6c4f into main Jun 4, 2026
3 checks passed
@iaj6 iaj6 deleted the fix/lint-ci-cleanup branch June 4, 2026 20:28
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