ESLint formatter that enforces a ratcheting threshold on total lint issues to prevent new violations from creeping in. Current stable version: 3.0.0. It generates a baseline file (eslint-ratchet.json) from the initial lint run, then fails future runs if the total issue count exceeds that baseline, and updates the baseline when the count improves. Provides styled output and supports bypassing normal ESLint erroring via environment variable. Unlike other formatters, it focuses on total issue count rather than specific rules, making it useful for incremental codebase improvements. Requires Node >=22 and ESM.
npm install eslint-formatter-ratchetNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Install the package and run ESLint with the ratchet formatter to set up a baseline that prevents new lint issues from being added.
Update Node.js to version 22 or later. If you must use an older Node, install eslint-formatter-ratchet@2.x.
Add eslint-ratchet-temp.json to your .gitignore file.
Ensure eslint-ratchet.json is committed to your repository. If lost, run eslint --format ratchet to regenerate it.
If you were using require('eslint-formatter-ratchet'), switch to import or use the CLI -f flag. Ensure your project is ESM or uses dynamic import.Understand that RATCHET_DEFAULT_EXIT_ZERO=true suppresses ESLint's own error exit, but the formatter will still fail on new issues. Use only when you want ESLint to ignore violation exits but still enforce ratcheting.
Use ESLint's -f flag with the formatter name: eslint -f ratchet. If you need to load it programmatically, use dynamic import: const formatter = await import('eslint-formatter-ratchet');Ensure eslint-formatter-ratchet is installed as a devDependency: npm install -D eslint-formatter-ratchet. Then run ESLint from the project root.
Run the formatter once to generate the baseline: eslint -f ratchet . This will create eslint-ratchet.json in the current working directory.
Use the ESLint CLI -f flag instead of programmatic use. Or change your file to .mjs extension or add "type": "module" to package.json.
No dependency data recorded yet.