Skip to main content

TypeScript analyzer

TypeScript Suppression Debt

Aggregates @ts-ignore/@ts-expect-error/@ts-nocheck and eslint-disable directives into per-file concentration signals.

technical-debt ts-suppression-debt

TypeScript Suppression Debt

Aggregates @ts-ignore/@ts-expect-error/@ts-nocheck and eslint-disable directives into per-file concentration signals.

Every suppression directive trades a compiler error or lint rule away at one site. Any single directive is often justified — interop boundaries, upstream type bugs, deliberate exceptions. What no per-site rule can show is concentration: the files where suppression accumulates are the files where the code and its declared standards disagree most, and that disagreement compounds silently across TypeScript and dependency upgrades. This analysis reports concentration as a trend signal and deliberately does not score it — the ts-type-safety analysis already charges ts-directives in its score, and double-charging the same debt would distort the composite.

Severity guide

info
Suppression concentration is informational: a place to look, never a verdict of wrongdoing.
warning
Not currently emitted by this analysis.
critical
Not currently emitted by this analysis.

Examples

Before

// @ts-ignore
const a = legacy.call();
// @ts-ignore
const b = legacy.other();
// @ts-ignore
const c = legacy.third();

After

const legacyApi = legacy as LegacyApi; // one precise boundary type
const a = legacyApi.call();
const b = legacyApi.other();
const c = legacyApi.third();

A cluster of suppressions around one dependency usually marks a boundary that deserves one precise type instead of many silenced errors.

Remediation

Treat clusters as boundaries needing precise types or lint-config decisions, not as sites to silence one by one.

For ts-directive clusters: prefer @ts-expect-error over @ts-ignore so stale suppressions surface as errors, and revisit clusters on TypeScript upgrades. For eslint-disable clusters: repeated disables of the same rule belong in the lint configuration for that path, where the decision is visible and reviewable — or the underlying pattern should be fixed.

Documentation