Type error suppressed
This is how the comment reads inline, under the flagged line.
Why it matters
Suppressed type errors are bugs the compiler already found. @ts-ignore also keeps hiding new errors on that line after the original is fixed.
What to do
Fix the type. If you must suppress, use @ts-expect-error with a reason.
Examples
// @ts-ignore user.nmae = name;
user.name = name;
What it catches
It reads a pattern on each line, aware of strings and comments. Languages: TypeScript and JavaScript. Scope: All files. These cases are the rule's own tests: the first set must be flagged and the second must not.
Flagged
// @ts-ignore const a = 1;
// @ts-nocheck
Left alone
// @ts-expect-error: the vendor types omit `signal` fetch(u, o);
Research
`@ts-ignore`, `eslint-disable`, bare `# noqa` and `# type: ignore`. A green check stops meaning the thing it checks is true.
- eslint-plugin-eslint-comments
- Ruff rules
- skill: ci-integrity-audit
Turn it off or change it
In a config file for the CLI, or in the API's rules field:
{
"rules": {
"disable": [
"ts-suppress"
],
"severity": {
"ts-suppress": "low"
}
}
}
@ts-ignorehides a type error instead of fixing it.