Repository navigation
fix: clear the lint backlog, gate lint in CI - #138
Merged
Merged
Conversation
redirect() threw inside a try whose catch called notFound(). Fetch with .catch(notFound) and render outside, as react-hooks requires.
The selected service and editable rows come from query data; no effects copying it into state.
Internal links use next/link; CSV exports are download links.
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.
Why
npm run lintcrashed onmainfor months, and CI never ran it. The ESLint upgrade in #134 made it run again, and it found 20 errors and 4 warnings. One of them was hiding a real bug.The bug
/dashboard/invoices/[id]/editcalledredirect()inside atrywhosecatchcallednotFound(). Both work by throwing, so opening the edit page for any non-draft invoice showed a 404 instead of redirecting to the invoice. Confirmed onmain's production image: 404. On this branch: 307 to/dashboard/invoices/<id>.Changes
react-hooks/error-boundaries(8, in 4 detail pages)await call().catch(() => notFound()), then branch and render outside the catch. Missing or malformed IDs still 404.react-hooks/set-state-in-effect(availability editor ×2)picked || first). Edits live in a draft tagged with the fetch it came from, so a refetch after save or a service switch shows the server's hours without an effect.react-hooks/set-state-in-effect(useIsMobile)hooks/use-mobile.tsand its only caller,components/ui/sidebar.tsx(723 lines), a scaffold component nothing imports.@next/next/no-html-link-for-pages(5)next/linkon contact, support/track, terms, and the consent banner.@next/next/no-html-link-for-pages(3, CSV exports)download. These are/apiroutes that sendContent-Disposition: attachment, and client routing would be wrong for them.react/no-unescaped-entities, 2× unused varssaveFiledrops its unusedmimeTypeparameter.@next/next/no-img-element(2 warnings)eslint.config.mjs. The image optimizer is disabled (DECISIONS 2026-09-30), sonext/imagewould render the same<img>.No
eslint-disablecomments were added.Gate: the
lintscript is noweslint --max-warnings=0, and CI runs it in the test job after type-check. CLAUDE.md, the FRAMEWORK pre-commit checklist, and/bootnow include it. A LESSONS entry records the redirect bug.Verification (Node 24.22.1, production image)
npm run lintexits 0.tsc,vitest(124/124), and the build pass. The full end-to-end regression passes: pages, login, PDFs, lead emails./book; terms "Privacy Policy" goes to/privacy. The closed-ticket page renders its/supportlink, and the export links carrydownload. No console errors.🤖 Generated with Claude Code