lint: type-checked eslint rules #7
Inga granskare
Etiketter
Inga etiketter
area/backups
area/ci
area/control-panel
area/identity
area/infra
area/observability
area/payments
area/security
area/storage
area/web
blocked
needs-info
needs-triage
priority
high
priority
low
priority
medium
ready-for-implementation
type
bug
type
chore
type
docs
type
epic
type
feature
type
task
wontfix
Ingen milstolpe
Inget projekt
Inga tilldelade
1 deltagare
Notiser
Förfallodatum
Inget förfallodatum satt.
Beroenden
Inga beroenden satta
Referens
bitborg/bitborg-payment!7
Läser in…
Hänvisa till i nytt ärende
Ingen beskrivning angiven.
Ta bort grenen "lint/type-checked"
Borttagning av en gren är permanent. Även om den borttagna grenen kan fortsätta existera en kort tid innan den faktiskt tas bort, kan det INTE ångras i de flesta fall. Vill du fortsätta?
Enables typescript-eslint's
recommendedTypeChecked(#59). Our eslint was syntax-only, so it wasstructurally unable to see the class of defect that matters most here: unawaited promises, and
anyfrom untyped API responses flowing into logic.
It found a real landmine on the refund path
src/provider/mollie.tscompared Mollie'sRefundStatusenum against a bare string literal:This type-checks and is correct today —
RefundStatus.refundeddoes equal"refunded". But itis not enum-safe: if that member's value ever shifted, the comparison becomes silently always-false
and every refund would report
"failed". That is the one code path where a wrong answer isfinancially consequential, and it is the same path that already carries the double-refund hazard
tracked separately.
Now compares
RefundStatus.refunded— behaviour-preserving today, and safe against the SDK changingunderneath us. No syntax-only rule could have seen this.
Also
no-unnecessary-type-assertioninmollie.test.ts— a redundantas never asdouble assertionreduced to a single
as. Auto-fixed; it still checks the same shape.parserOptions.projectServicewithallowDefaultProjectfor the root config files(
vitest.config.ts,drizzle.config.ts,*.mjs). Without it they fail to parse rather than beinglinted, since they sit outside tsconfig's
include.Why
recommendedTypeCheckedand notstrictTypeCheckedThe stricter tier is declared non-stable upstream, and its
no-unnecessary-conditionrule fires onexactly the defensive guards that protect untrusted runtime data — which this service has
deliberately. Not worth the false-positive tax.
Verified by the hooks on the way in: pre-commit ran eslint clean, pre-push ran build plus the full
suite (58 tests, 9 files).
Refs #59