suppress-eslint-errors
raw JSON → 3.0.2 verified Sat Apr 25 auth: no javascript
A jscodeshift-based codemod that runs ESLint against your codebase and adds eslint-disable-next-line comments for all existing violations, allowing gradual adoption of new rules. Current stable version is 3.0.2 (released under a new maintainer). Release cadence is sporadic, with major version bumps for breaking changes. Key differentiator: unlike manual rule disabling or lint suppressions, this automates the tedious process of adding suppression comments for legacy code, enabling teams to enable strict rules without immediate rewrites. Requires ESLint locally installed and Node >= 18.
Common errors
error Error: Could not find a local ESLint installation. Please install ESLint in your project. ↓
cause ESLint is not installed as a project dependency.
fix
Run 'npm install --save-dev eslint' or 'yarn add --dev eslint'.
error Error: jscodeshift is not recognized as an internal or external command ↓
cause jscodeshift is not found in PATH when using the wrapper.
fix
Install jscodeshift as a dependency: 'npm install --save-dev jscodeshift' or run the tool via npx (it bundles jscodeshift internally).
error TypeError: Cannot read properties of undefined (reading 'range') ↓
cause The tool encountered a file that is not parsable by ESLint (e.g., binary, or syntax error).
fix
Run ESLint directly first to identify problematic files, then exclude them or fix the syntax.
error Error: Path must be a string. Received undefined ↓
cause No file path was provided to the CLI command.
fix
Provide one or more file/directory paths as positional arguments: 'npx suppress-eslint-errors ./src'.
Warnings
breaking v3.0.0 dropped support for Node < 18. Upgrade Node to version 18 or later. ↓
fix Update Node to >= 18 and reinstall suppress-eslint-errors.
breaking v3.0.0 changed the CLI arguments; the --message option now requires a string without special characters. Previously it could be any string. ↓
fix When using --message, ensure it does not contain shell metacharacters or use quotes.
deprecated v2.0.0 deprecated the --ignore-config flag; now .gitignore is automatically detected. ↓
fix Remove --ignore-config from your command line.
gotcha The tool only suppresses errors, not warnings. If you have warnings you want to suppress, upgrade them to errors in your ESLint config or use --rules to specify them. ↓
fix Either change your ESLint config to treat the rule as an error (e.g., 'warn' -> 'error') or pass the rule IDs via --rules.
gotcha JSCodeshift may mishandle .gitignore files with certain patterns, causing all files to be ignored. The tool attempts to detect this but may still skip files. ↓
fix Review the output to ensure files are processed; if not, run without .gitignore handling by removing the file temporarily.
deprecated ESLint flat config is not yet supported. The tool expects a traditional .eslintrc config. ↓
fix Use a legacy ESLint configuration format (e.g., .eslintrc) until flat config support is added.
Install
npm install suppress-eslint-errors yarn add suppress-eslint-errors pnpm add suppress-eslint-errors Imports
- suppress-eslint-errors (binary) wrong
npx eslint-suppress-errorscorrectnpx suppress-eslint-errors [options] PATH... - transformer (internal) wrong
const transformer = require('suppress-eslint-errors');correctconst transformer = require('suppress-eslint-errors/transformer'); - cli (direct)
require('suppress-eslint-errors/cli')
Quickstart
npx suppress-eslint-errors ./src --extensions=js,jsx --rules=eqeqeq,@typescript-eslint/no-explicit-any