TypeScript Type Safety
Detects type-system escape hatches: @ts-nocheck, @ts-ignore, 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, 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 (e.g., branded types) is in use.
- 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 — 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.