Skip to content

invalid-lint-suppression

Reports a malformed suppression comment or an unknown rule name in one.

This rule reports a suppression comment that the CLI cannot read, such as a comment with a misspelled rule name. The comment suppresses nothing, so the finding that you meant to hide still appears.

Reported

// swlint-disable-next-line no-arbitary-colors -- Partner brand color.invalid-lint-suppression: invalid lint suppression: unknown rule `no-arbitary-colors`
style("bg-[#123456]");

Fixed

// swlint-disable-next-line no-arbitrary-colors -- Partner brand color.
style("bg-[#123456]");

How to fix

  • Correct the rule name. The lint rule reference lists every name.
  • Check the form of the comment: swlint-disable-next-line, swlint-disable-line, or a swlint-disable and swlint-enable pair, followed by rule names.

See Suppression comments.

Rule settings

PresetSeverity
recommendedwarn
strictdeny
stylisticoff

Configure lint to change the severity or options.