chore(lint): make the repo lint-clean and add a CI Lint job (#25)#5
Merged
Conversation
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]>
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
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-hookserrors were fixed behavior-preservingly (each traced against callers + the adversarial review):SessionsTablestatic-componentsSortIconto module scope; passsortBy/sortDiras propsSessionDetailset-state-in-effectloadingfromrunIds.lengthinstead ofsetStatein the effectWebhooksSectionset-state-in-effectcancelledguard; keptloadList()for refreshespage.tsxpurityeslint-disable— it's a server component,Date.now()per-request is correctuseEventSourceimmutabilityeslint-disable— the self-referencing reconnect timer is runtime-safePlus:
RunsTablegained a missingsearchParamsdep on auseCallback(fixes a real stale-closure bug); unused imports/vars removed; apostrophes escaped;require()→importin two test helpers.Other packages
A shared
eslint.config.base.mjs(typescript-eslintrecommended, light:no-explicit-anyoff,unused-vars/requireas warn) re-exported bycore/db/cli/sdk— each error-free (advisory warnings remain). No new deps:typescript-eslintresolves via workspace hoisting (transitive of web'seslint-config-next), documented inline.CI
New Lint job runs
npm run lint(fails on errors only).lintscripts added per package + at root.Verification
Full build clean; 1166 tests pass;
npm run lintexits 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 afternpm ci.Follow-up (own PR)
Declare
eslint+typescript-eslintas explicit root devDependencies rather than relying on hoisting — deferred because it requires regeneratingpackage-lock.json(the documented macOS→Linux optional-deps procedure). Not a current CI break.🤖 Generated with Claude Code