Straitjacket

Suppression markers

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 step-by-step walkthrough see Suppress a false positive.

Line scope

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

marker effect
straitjacket-allow suppress 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.

marker effect
straitjacket-allow-file exempt 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