Skip to content

chore: add useUnknownInCatchVariables to tsconfig#71

Merged
jan-kubica merged 1 commit intomainfrom
chore/align-tsconfig
Mar 23, 2026
Merged

chore: add useUnknownInCatchVariables to tsconfig#71
jan-kubica merged 1 commit intomainfrom
chore/align-tsconfig

Conversation

@jan-kubica
Copy link
Copy Markdown
Contributor

@jan-kubica jan-kubica commented Mar 23, 2026

Summary

  • Add useUnknownInCatchVariables: true to align with Stella's strict TypeScript config
  • This was the only missing compiler option; all other strict settings were already present

Test plan

  • tsc --noEmit passes (no catch blocks in src/)
  • bun test passes (pre-existing unrelated failure in de.handelsreg)

Open with Devin

Align with Stella's strict TypeScript settings. This was the
only missing compiler option.
@greptile-apps
Copy link
Copy Markdown

greptile-apps bot commented Mar 23, 2026

Greptile Summary

This PR adds "useUnknownInCatchVariables": true to tsconfig.json in an effort to align with Stella's strict TypeScript configuration. The change is harmless — it does not affect compilation behaviour — but it is redundant because useUnknownInCatchVariables has been automatically enabled by "strict": true" since TypeScript 4.4, which is already present in the config.

Key points:

  • The stated goal (aligning with a strict TS config) is already met by the existing "strict": true flag
  • Every other explicitly listed option in the file (exactOptionalPropertyTypes, noUncheckedIndexedAccess, noUnusedLocals, noUnusedParameters, etc.) is genuinely additive — they are not covered by strict. useUnknownInCatchVariables is the exception
  • No source files are affected and no runtime or compile-time behaviour changes

Confidence Score: 4/5

  • Safe to merge — the change is redundant but entirely harmless and does not alter compilation or runtime behaviour.
  • Single-line config change that duplicates an already-active flag. No source code is touched, no behaviour changes, and tsc --noEmit and tests are reported as passing.
  • No files require special attention beyond the noted redundancy in tsconfig.json.

Important Files Changed

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
Loading

Reviews (1): Last reviewed commit: "chore: add useUnknownInCatchVariables to..." | Re-trigger Greptile

Comment thread tsconfig.json
"noFallthroughCasesInSwitch": true,
"noImplicitOverride": true,
"noImplicitReturns": true,
"useUnknownInCatchVariables": true,
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 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.

Suggested change
"useUnknownInCatchVariables": true,

Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 1 additional finding.

Open in Devin Review

@jan-kubica jan-kubica merged commit 34b4947 into main Mar 23, 2026
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant