Conversation
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.
What changed
Guardrails that keep the campaign's gains: type-aware lint rules (floating and misused promises, exhaustive switches, non-Error throws and rejections, string coercion of objects, redundant types and unnecessary assertions),
noUnusedLocals, and new steps in the existing CI build job for formatting, the dynamic-SQL guard, unused code (knip), duplication (jscpd) and the email worker's tests. The code changes are the ones those checks demanded, none of which changes behavior.Before you start
Verify
Nothing new to verify in the app: the checks run in CI. Every step below is a regression check.
Regression
Requesting your data — [Web]
Admin reports — [Admin]
Photo reports — [Web] [Mobile]
Findings addressed
Campaign PR 14 (guardrails).
typed()in the config package):no-floating-promises,no-misused-promisesandawait-thenablefound nothing, and they now keep it that way. Also on:no-for-in-array,no-implied-eval,only-throw-error,prefer-promise-reject-errors,restrict-template-expressions,no-base-to-string,no-redundant-type-constituents,switch-exhaustiveness-check(adefaultcounts as exhaustive) andno-unnecessary-type-assertion.noUnusedLocalsin the base tsconfig.check:sql, until now a manual script), knip, jscpd and the email worker's install and tests (it has its own lockfile). No job was added or renamed, so the required checks are unchanged.testcontainersdevDependency removed (the Postgres module still brings it); the media worker's storage and error-reporting dependencies are declared as used by the bundled api code; two ops scripts documented in runbooks are entries rather than dead files.srctoday; the threshold is 0.5%, so growth fails and today passes.Decisions for the reviewer
response.json()now pass the type argument instead (json<T>()), so their types stay identical. The one runtime-visible edit isString(status)in an admin error message's default branch, identical for the string values that reach it; the data export's compile-time section check now also names the array the export iterates (the same array).vi.hoistedfactories, a rollback sentinel thrown on purpose in the demo seeders,String()fallbacks in diagnostics, one deliberate pass-through of a non-Error rejection, tests that must reject with SMTP-shaped plain objects, and the test helper that builds predicates withnew Function.return-await(fixing it changes which errors acatchsees),unbound-method,no-unnecessary-conditionandrequire-await(86 to 400 findings each, mostly noise), andnoImplicitReturns..git-blame-ignore-revsis not added: it must name the squash commit of Backend formatting pass with the repo's Prettier config #91 (formatting), which exists only once Backend formatting pass with the repo's Prettier config #91 merges.User-visible copy changes
None.
Tests changed
as Tonjson()tojson<T>()(same types).Error(all callers already pass one).Verification
pnpm lint(type-aware, about 110 s),pnpm typecheck,pnpm format:check,pnpm check:sql,pnpm knip,pnpm dup:checkand the email worker's 16 tests pass.Staging checks
https://api.civfix.dev/readyzanswers ready (no migration in this PR).Not covered
🤖 Generated with Claude Code