Tune or disable rules
Run a subset of rules, adjust thresholds, and change how findings are reported.
Straitjacket runs every rule at its strictest by default. You ratchet down from there. This guide covers the common adjustments; the full flag list is in the CLI reference.
Run only some rules
straitjacket --only emoji,color # nothing but these two
straitjacket --skip motion,slop-prose # everything except these--only and --skip take comma-separated rule ids. Unknown ids print a warning
and are ignored. See every id in the rules reference or
with straitjacket --list-rules.
Adjust thresholds
Several rules have a tunable number:
straitjacket --max-lines 800 # file-size line budget (0 disables)
straitjacket --prose-window 600 # slop-prose density window, in characters
straitjacket --dup-min-tokens 80 # only flag duplicated blocks this large--max-lines— how long a file may be beforefile-sizefires. Default 1500.--prose-window— the character windowslop-proseslides while scoring density. Wider = more forgiving. Default 400. See How slop-prose works.--dup-min-tokens— the smallest cloneduplicationwill report. Higher = fewer, larger duplicates. Default 50. See Why duplication is compiled in.
Report cross-file prop-drilling depth
The prop-drilling rule flags a single forwarding hop but can't tell a harmless
one-level pass from a deep drill. This mode stitches the per-file forwarding
edges into a cross-file graph and prints each drill chain longest-first, then
exits:
straitjacket --prop-chainsdepth 2: ArchiveRow.task → TaskLinks.task → ReviewLink.task
from src/web/panes/archive/ArchiveRow.tsx:50More in Prop-drilling and drill depth.
Change the output
straitjacket --format json # machine-readable findings
straitjacket --no-fail # report everything but always exit 0--format json is the right choice when another tool consumes the results.
--no-fail is useful while adopting Straitjacket — you see findings without
breaking the build.
Make it stick
Rather than remember these flags for every run, commit a
.straitjacket.yaml to the repo — the same
settings in one file, picked up automatically by every run and by CI:
# .straitjacket.yaml
skip: [motion, slop-prose]
max-lines: 800
dup-min-tokens: 80