slop/escape-hatches
Lint and type suppressions are reviewed
| Severity | info |
| Tiers | all |
| Stacks | any |
| Scope | root |
| Kind | expr |
| Source | library v0.3.1 |
| Selected by | fleetlint-slop@v0.3.1 |
Requirement
Suppressions are rare and each has a reason next to it: @ts-ignore, @ts-expect-error, as any, eslint-disable, nolint, NOLINT, noqa, type: ignore, pylint: disable, pyright: ignore, rubocop:disable, phpstan-ignore, @Suppress, @SuppressLint, [SuppressMessage], #pragma warning disable, Dart ignore: and Rust #[allow]. This rule lists them for review; it cannot tell a justified one from an unjustified one.
Why
Each suppression switches a check off for good; a list of them is the fastest audit of where the checks do not apply.
Check
For each item in:
codegrep("nontest", r'@ts-(ignore|nocheck|expect-error)|\bas any\b|:\s*any\s*([,;)=\]>]|$)|#\s*type:\s*ignore|eslint-disable|//\s*nolint|\bNOLINT|#\s*noqa|pylint:\s*disable|pyright:\s*ignore|rubocop:disable|@?phpstan-ignore|@psalm-suppress|@Suppress(Warnings|Lint)?\(|\[SuppressMessage\(|#pragma warning disable|//\s*ignore(_for_file)?:|#!?\[allow\(')falseFix
Fix the code instead of suppressing, or state the reason on the same line.
Agent instruction: For each suppression, try the fix first; if it stays, add the specific rule name and a one-line reason.
See: https://fleetlint.org/baseline/#slop, https://fleetlint.org/slop/#errors-types-and-robustness
Generated by fleetlint docs from catalog v0.3.1.