eslint-filtered-fix

raw JSON →
0.3.0 verified Sat Apr 25 auth: no javascript

A CLI tool and Node.js API to selectively apply ESLint auto-fixes, allowing control over which rules are fixed or to exclude warnings. Version 0.3.0 (latest) supports ESLint >=7.0.0, with async API. Unlike ESLint's built-in --fix, it enables fixing individual rules (--rule) or disabling warning fixes (--no-warnings), producing focused commits. It wraps ESLint's fix functionality and requires an existing ESLint configuration. Release cadence is low; last release was v0.3.0 in 2021.

error Error: Cannot find module 'eslint-filtered-fix'
cause Package is not installed in node_modules.
fix
Run npm install --save-dev eslint-filtered-fix
error TypeError: fix is not a function
cause Importing incorrectly - fix is a named export, not default.
fix
Use import { fix } from 'eslint-filtered-fix' or const { fix } = require('eslint-filtered-fix')
error Cannot read property 'CLIEngine' of undefined
cause Incompatible ESLint version; ESLint >=7 required.
fix
Upgrade ESLint to version 7+ or use eslint-filtered-fix@0.1.x for ESLint 6.
breaking Node.js API changed from synchronous to async in v0.2.0. Older code using `const results = fix(files, opts)` without await will get a promise instead of results.
fix Use `await fix(files, opts)` or handle promise with `.then()`.
breaking Requires ESLint >=7.0.0 as peer dependency since v0.2.0. Older ESLint versions (<=6.x) are incompatible.
fix Upgrade ESLint to version 7.0.0 or higher, or use eslint-filtered-fix @0.1.x.
gotcha The --rule argument with array syntax must not contain spaces: `--rule [semi,no-console]` is correct, `--rule [semi, no-console]` is invalid.
fix Write --rule [rule1,rule2] without spaces inside the brackets.
gotcha Using --no-warnings also suppresses all warnings from ESLint output, not just autofix warnings. This can hide important lint issues.
fix Omit --no-warnings to see all warnings; use --rule to fix only specific rules instead.
deprecated ESLint 7 is now end-of-life; future versions may drop support. The package may not be actively maintained.
fix Consider migrating to ESLint 8 or 9; check for updates or alternatives like eslint-nibble.
npm install eslint-filtered-fix
yarn add eslint-filtered-fix
pnpm add eslint-filtered-fix

Fix only 'semi' and 'quotes' rules in src/ while ignoring warnings.

npx eslint-filtered-fix src/ --rule semi --rule quotes --no-warnings