Skip to main content

TypeScript analyzer

Type-Aware TypeScript

Checker-backed findings from a full tsconfig-driven project pass: real any propagation, unnecessary non-null assertions, cross-file inheritance depth, dead union members, defeated generic constraints, pointless type predicates, and redundant utility types.

patterns ts-type-aware

Type-Aware TypeScript

Checker-backed findings from a full tsconfig-driven project pass: real any propagation, unnecessary non-null assertions, cross-file inheritance depth, dead union members, defeated generic constraints, pointless type predicates, and redundant utility types.

Syntax-only analysis must guess wherever meaning depends on resolved types, and those guesses lie in both directions: an untyped destructuring looks fine while flowing any everywhere, and a suspicious-looking assertion may be exactly right. This family runs one tsconfig-driven, fully type-checked project pass (a deep-analysis provider on desktop, --type-aware on the CLI) and reports only what the checker can prove. Findings are identified by a project-scoped key — they depend on the whole program, so per-file caching would serve stale results.

Severity guide

info
Checker-proved observations whose fix is judgment-dependent.
warning
Provably wrong or provably useless constructs (unnecessary assertions, unreachable union members).
critical
Not emitted by this family.

Examples

Before

const value = config.apiKey!; // narrowing already proved non-null

After

const value = config.apiKey;

The checker knows the type is already non-nullable here; the assertion only hides future regressions.

Remediation

Each template names the proof; fix the construct the proof invalidates.

Type-aware findings carry the checker’s reasoning in their message: remove assertions the checker proves unnecessary, delete union arms no value can produce, replace pointless predicates with unknown-parameter guards, and unwrap redundant utility types. For any-reachability, add the annotation or generic argument that stops the propagation at its source.

Documentation