Skip to main content
New aislop v0.13.1 patch — calibrates hidden-fallback detection and fixes regex comment-masker false positives. Read the changelog →
ai-slop/ts-directive manual fix

Unexplained TypeScript directive.

A `@ts-ignore`, `@ts-expect-error`, or `@ts-nocheck` directive without a reason comment. Silences the type checker on that line forever.

Flagged shape and clean shape.

Each example shows the exact code shape the rule is looking for, then the smallest version that keeps the intent without hiding risk or adding noise.

Flagged example
const payload = {
  accountId: account.id,
  retryPolicy: 'exp',
}

// @ts-ignore
legacyClient.createSubscription(payload)
Why this trips

Deterministic regex match: flags `@ts-ignore`, `@ts-expect-error`, or `@ts-nocheck` with no trailing reason text.

Clean example
const payload = {
  accountId: account.id,
  retryPolicy: 'exp',
}

// @ts-expect-error legacy client types lag retryPolicy support — SDK-421
legacyClient.createSubscription(payload)
What changed

Prefer fixing the type error. If the dependency or compiler is wrong, use the narrowest directive available and include a reason with a tracking reference so it can be removed later.

Agents silence type errors instead of solving them. Without a reason, the directive becomes load-bearing and nobody can safely remove it later.

How this rule is justified.

Rule id

ai-slop/ts-directive

Enforcing engine

ai-slop

Detector strategy

Deterministic regex match: flags `@ts-ignore`, `@ts-expect-error`, or `@ts-nocheck` with no trailing reason text.

Legitimate code that is NOT flagged

A directive followed by an explanatory reason (ideally with a tracking reference) is not flagged.

Evidence

Provenance: repeated across public scans where agents suppress type errors instead of resolving them.