Registry / testing / eslint-plugin-autofix

eslint-plugin-autofix

JSON →
library2.2.0jsnpmunverified

An ESLint plugin (v2.2.0) that wraps ESLint core and custom rules to provide autofix functionality. It converts original fixable rules into autofixable versions by applying fixes automatically. Requires Node.js >=18 and ESLint >=8. The plugin prefixes rule names with 'autofix/' and includes a wide range of ESLint built-in rules. Released as part of a monorepo with similar plugins like eslint-plugin-no-autofix. Supports ESLint v9 as of v2.0.0. Differentiator: enables autofix for rules that are normally not fixable, but does not modify the original rule behavior.

npm install eslint-plugin-autofix
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-AUTO
E
eslint-plugin-autofix
testingjavascriptv2.2.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

plugin
import autofix from 'eslint-plugin-autofix';
const eslintPluginAutofix = require('eslint-plugin-autofix');
ESM import is preferred; CommonJS require still works but import is recommended for modern projects.
rules
import autofix from 'eslint-plugin-autofix'; // then use autofix.rules
import { rules } from 'eslint-plugin-autofix';
The plugin is a default export, not named exports. Access rules via autofix.rules.
configs
import autofix from 'eslint-plugin-autofix'; // then use autofix.configs
import { configs } from 'eslint-plugin-autofix';
Configs are exported as part of the default object. Use autofix.configs to access recommended config.

Example ESLint configuration using eslint-plugin-autofix to enable autofix for no-debugger and no-unused-vars rules.

// .eslintrc.js module.exports = { plugins: ['autofix'], rules: { 'autofix/no-debugger': 'error', 'autofix/no-unused-vars': ['error', { args: 'none' }], }, };
Debug
Known issues
breakingv2.0.0 dropped support for ESLint <8 and Node.js <18. Upgrade to ESLint 8+ and Node 18+.
fix
Update ESLint to >=8 and Node.js to >=18.
affects: <2.0.0
deprecatedThe plugin may not be actively maintained; check the repository for recent updates. Last release was v2.2.0 in 2024-09.
fix
Consider monitoring the repo for updates or using ESLint's built-in autofix.
affects: >=0.0.0
gotchaRule names must be prefixed with 'autofix/' in the eslintrc rules object. Omitting the prefix will use the original ESLint rule without autofix.
fix
Always use 'autofix/<rule-name>' format.
affects: >=0.0.0
gotchaThe plugin does not modify the original rule's behavior; it only applies fixes to the reported errors. Some rules may not produce fixes even if the rule name is prefixed.
fix
Check the rule's documentation to see if it is fixable.
affects: >=0.0.0
Errors
Common errors & fixes
ESLint: Failed to load plugin 'autofix' declared in '.eslintrc'
eslint-plugin-autofix not installed or version incompatible with ESLint version.
fix
Run 'npm install eslint-plugin-autofix --save-dev' and ensure ESLint version is >=8.
ESLint: Error while loading rule 'autofix/no-unused-vars': Rule 'no-unused-vars' is not defined in plugin 'autofix'.
The autofix rule name does not map to any existing rule in the plugin or the original ESLint rule does not exist.
fix
Verify that 'no-unused-vars' is a valid ESLint rule; the autofix plugin wraps most ESLint core rules.
ReferenceError: require is not defined in ES module scope
Using CommonJS require in an ESM project (type: 'module' in package.json).
fix
Use 'import autofix from 'eslint-plugin-autofix'' instead of require.
Upgrade
Version history
2.2.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; plugin requires ESLint >=8 to function
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-autofix — npm install eslint-plugin-autofix · libregistry