Bulk suppressions
Bulk suppressions let you enable stricter lint rules on an existing project without fixing every legacy violation up front. Rslint records the current error count per file and rule in a JSON file (default rslint-suppressions.json), using the same workflow and format as ESLint's bulk suppressions.
Existing violations up to the recorded count are suppressed, while new violations fail linting as usual.
Record existing errors
- Enable the rules you want to adopt at
"error"severity in your Rslint config. - Run Rslint from your project root to record current violations:
- Commit the generated
rslint-suppressions.jsonalongside your config.
After that, running rslint from the same project directory automatically reads rslint-suppressions.json and suppresses the recorded errors.
How the suppressions file works
Each entry stores the allowed error count for a file and rule:
- New errors are caught: if
src/app.jsgrows from 2 to 3no-debuggererrors, Rslint reports all 3 errors and exits with code1. - Line moves don't break suppressions: moving the 2 existing
no-debuggercalls to other lines keeps the count at 2. - Paths are relative to the working directory: run
rslintfrom the same project directory locally and in CI so file paths match.
Remove unused suppressions
When you fix legacy violations, the recorded count becomes higher than the actual error count. Rslint still suppresses the remaining errors, but exits with code 2 to remind you to update the baseline.
Run --prune-suppressions to lower counts and remove entries that are no longer needed:
Pruning lowers counts for fixed violations, deletes rules that reach zero, and removes entries for files that no longer exist on disk. Run it from a full checkout so files outside the current check are not treated as deleted.
If you want to defer cleanup temporarily (for example, while iterating locally), pass --pass-on-unpruned-suppressions:
Custom location and ESLint migration
Use --suppressions-location to store the suppressions file somewhere else, or to reuse an existing ESLint suppressions file directly:
Pass --suppressions-location on every subsequent run that should use that file. When you pass an existing directory (or a path ending with / or \), Rslint stores a project-specific rslint-suppressions_<hash> file inside it.
Options
Notes
- Only lint errors are suppressed: rules configured as
"warn"are still reported and still count toward--max-warnings. Syntax errors and TypeScript compiler diagnostics (--type-check) are always reported. - One mode per run: choose at most one of
--suppress-all,--suppress-rule, or--prune-suppressionsin a single invocation. --type-check-only: skips the suppressions file and cannot be combined with--suppress-all,--suppress-rule, or--prune-suppressions.- Safe on incomplete runs: ignored files, files with syntax errors, and rules or files that could not finish checking (such as during a config or plugin error) keep their existing suppression counts instead of being cleared unexpectedly.
- Avoid concurrent writes to the same file: do not run multiple recording or pruning processes against the same suppressions file at the same time. Run Rslint once from the project root, or give each parallel job its own
--suppressions-location.