lint: type-checked eslint rules #15
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-auth-reconciler!15
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 couldnot see unawaited promises or
anyfrom untyped API responses flowing into logic — the defect classthat matters most in a service that mutates production Forgejo and Kanidm.
21 findings, and the interesting part is where they were
20 of the 21 were
require-await— and every one is in test scaffolding, not production code:src/testing/fakes.ts(which its own header describes as "Recording fakes for the Kanidm and Forgejoseams") and
src/members.test.ts.That distinction decides the fix. The fakes declare
asyncto satisfy the real client interfaces andthen return canned values, so there is nothing to await — that is the point of a fake, not an
oversight. Every production
asyncin this repo does await properly (forgejo-http.ts'shard()awaits
this.request(...), and so on).So
require-awaitis switched off for**/*.test.tsandsrc/testing/**only, via the config'sexisting "Test ergonomics" override block — which already scopes
no-dynamic-deleteandno-non-null-assertionthe same way. It stays on everywhere else, where a missing await is agenuine bug.
The alternative — mass-editing 20 call sites in code that provisions and mutates production
infrastructure to satisfy a rule that has no signal there — would have been the wrong trade.
Also
no-unnecessary-type-assertion, auto-fixedparserOptions.projectServicewithallowDefaultProjectfor the root config files (*.mjs,vitest.config.ts), which otherwise fail to parse rather than being lintedWhy
recommendedTypeCheckedand notstrictTypeCheckedThe stricter tier is declared non-stable upstream, and its
no-unnecessary-conditionrule fires onexactly the defensive guards that protect untrusted runtime data. Not worth the false-positive tax.
Refs #59