Downgrade ESLint errors to warnings.
npm install --save-dev eslint-plugin-only-warn
Using flat config files:
// eslint.config.js
import "eslint-plugin-only-warn";
export default [
...
Or, when the package.json that doesn't have "type": "module"
:
require("eslint-plugin-only-warn");
Add only-warn
to the plugins section of your .eslintrc
configuration file:
{
"plugins": ["only-warn"]
}
Add --max-warnings=0 to the eslint command in package.json
"lint": "eslint --max-warnings=0 ...",
Adding the option allows git hooks or CI pipelines to detect failed linting rules. Because the cli now has a nonzero exitcode when it encountered linting warnings.
Use Husky and lint-staged to prevent committing code that contain eslint warnings.