TypeScript Type Safety
Detects type-system escape hatches: @ts-nocheck, @ts-ignore, @ts-expect-error, any usage, double assertions, implicit any catch clauses.
TypeScript provides several escape hatches for cases where the type system can't reason about runtime behavior: any, double assertions (as unknown as T), @ts-ignore, @ts-expect-error, and @ts-nocheck. Each one is sometimes necessary but bypasses the safety net. This analysis surfaces every escape-hatch use so they can be reviewed and replaced with narrower types when possible.
Severity guide
- info
- A positive type-safety pattern is in use, or a low-severity escape hatch (@ts-expect-error, an implicit `any` catch variable) is present.
- warning
- A type-safety escape hatch is present; verify it is necessary and consider tightening.
- critical
- Type checking is entirely disabled or a double assertion subverts the safety net. This is high risk.
Remediation
Replace any with specific types or generics; remove @ts-nocheck; replace double assertions with proper type guards.
Replace any with specific types or generics; remove @ts-nocheck; replace double assertions with proper type guards.