Straitjacket

Suppression markers

Exact syntax and matching semantics for straitjacket-allow and straitjacket-allow-file.

Straitjacket has two escape hatches, both plain marker text. It matches the text anywhere on a line — the surrounding comment syntax (//, #, /* */, <!-- -->) doesn't matter, so use whatever's valid in the file. For a task-oriented walkthrough see Suppress a false positive.

Line scope

A marker on a line suppresses findings on that same line.

markereffect
straitjacket-allowsuppress every rule on this line
straitjacket-allow:<rule>suppress only <rule> on this line
const brandColor = "#ff6600"; // straitjacket-allow:color  brand color, not themeable

Text after the marker is free-form — use it to record why.

File scope

A marker on any one line of a file exempts the whole file. The top of the file is conventional.

markereffect
straitjacket-allow-fileexempt every rule for the whole file
straitjacket-allow-file:<rule>exempt only <rule> for the whole file
/* straitjacket-allow-file:color  design tokens — colors live here */
:root { --bg: #1e1e1e; --fg: #abb2bf; }

Choosing a scope

  • Prefer the rule-scoped form (straitjacket-allow-file:color) over the blanket one — it keeps every other rule live on the file.
  • Whole-file rules need file scope. file-size and slop-prose don't attach to a single source line, so a per-line straitjacket-allow won't silence file-size; use straitjacket-allow-file:file-size. slop-prose can be suppressed per-line (for one offending line) or per-file (for a document that legitimately quotes AI-slop examples).
  • <rule> is any rule id from the rules reference — the same ids --only and --skip accept.

On this page