chore: add useUnknownInCatchVariables to tsconfig#71
Conversation
Align with Stella's strict TypeScript settings. This was the only missing compiler option.
|
| Filename | Overview |
|---|---|
| tsconfig.json | Adds useUnknownInCatchVariables: true explicitly, but this flag is already enabled by the existing strict: true setting, making the addition redundant (though harmless). |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A["tsconfig.json\n(strict: true)"] -->|"implicitly enables"| B["useUnknownInCatchVariables: true\n(since TS 4.4)"]
A -->|"explicitly set\n(additive — not in strict)"| C["exactOptionalPropertyTypes\nnoUncheckedIndexedAccess\nnoUnusedLocals\nnoUnusedParameters\nnoFallthroughCasesInSwitch\nnoImplicitOverride\nnoImplicitReturns"]
D["PR adds explicit\nuseUnknownInCatchVariables: true"] -.->|"redundant — already active"| B
Reviews (1): Last reviewed commit: "chore: add useUnknownInCatchVariables to..." | Re-trigger Greptile
| "noFallthroughCasesInSwitch": true, | ||
| "noImplicitOverride": true, | ||
| "noImplicitReturns": true, | ||
| "useUnknownInCatchVariables": true, |
There was a problem hiding this comment.
Redundant flag — already covered by
strict: true
useUnknownInCatchVariables has been included as part of the TypeScript strict mode since TypeScript 4.4. Because line 8 already has "strict": true, this flag is already implicitly active.
All other explicit options in this file (exactOptionalPropertyTypes, noUncheckedIndexedAccess, noUnusedLocals, noUnusedParameters, noFallthroughCasesInSwitch, noImplicitOverride, noImplicitReturns) are not covered by strict: true and therefore warrant explicit listing. This one is the exception.
Adding it explicitly is harmless and won't change behaviour, but it is inconsistent with the pattern of the file and could mislead future maintainers into thinking it isn't already covered by strict.
| "useUnknownInCatchVariables": true, |
Summary
useUnknownInCatchVariables: trueto align with Stella's strict TypeScript configTest plan
tsc --noEmitpasses (no catch blocks in src/)bun testpasses (pre-existing unrelated failure in de.handelsreg)