No @ts-ignore comments without explanation
Why it matters
A bare @ts-ignore tells TypeScript to stop checking the next line with no record of why. When the underlying problem is later fixed (a third-party type definition is updated, a library is upgraded), the suppression remains silently in place — a form of type-safety debt that accumulates until something breaks. ISO 25010:2011 §6.5.2 classifies unexplained suppressions as a maintainability defect. More than three @ts-ignore comments in a codebase is a signal that developers are routinely bypassing the compiler rather than fixing the underlying type issues.
Severity rationale
High because unexplained type suppressions accumulate as maintenance debt and mask real type errors that would otherwise be caught before they reach production.
Remediation
For each @ts-ignore, evaluate whether the underlying type error can be fixed properly. If suppression is genuinely necessary, replace it with @ts-expect-error and a comment — @ts-expect-error will itself error if the problem is later resolved, preventing comment rot.
// Before (silent suppression, no context):
// @ts-ignore
element.customProperty = value;
// After (documented, self-removing when the type is fixed):
// @ts-expect-error: missing from HTMLElement types, tracked in #42
element.customProperty = value;
For third-party libraries with incorrect types, prefer module augmentation or contributing a fix to @types/ over suppressing the error.
DetectionPro
The detection method for this pattern is part of AuditBuffet Pro.
The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the Code Quality Essentials Audit. The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.
External references
- iso-25010:2011 · maintainability.analysability — Maintainability — Analysability
Taxons
History
- 2026-04-18·v1.0.0·Initial import from code-quality-essentials·automated