{"id":19692,"library":"eslint-plugin-autofix","title":"eslint-plugin-autofix","description":"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.","status":"active","version":"2.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/aladdin-add/eslint-plugin#master","tags":["javascript","eslint plugin","autofix"],"install":[{"cmd":"npm install eslint-plugin-autofix","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-autofix","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-autofix","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin requires ESLint >=8 to function","package":"eslint","optional":false}],"imports":[{"note":"ESM import is preferred; CommonJS require still works but import is recommended for modern projects.","wrong":"const eslintPluginAutofix = require('eslint-plugin-autofix');","symbol":"plugin","correct":"import autofix from 'eslint-plugin-autofix';"},{"note":"The plugin is a default export, not named exports. Access rules via autofix.rules.","wrong":"import { rules } from 'eslint-plugin-autofix';","symbol":"rules","correct":"import autofix from 'eslint-plugin-autofix'; // then use autofix.rules"},{"note":"Configs are exported as part of the default object. Use autofix.configs to access recommended config.","wrong":"import { configs } from 'eslint-plugin-autofix';","symbol":"configs","correct":"import autofix from 'eslint-plugin-autofix'; // then use autofix.configs"}],"quickstart":{"code":"// .eslintrc.js\nmodule.exports = {\n  plugins: ['autofix'],\n  rules: {\n    'autofix/no-debugger': 'error',\n    'autofix/no-unused-vars': ['error', { args: 'none' }],\n  },\n};","lang":"javascript","description":"Example ESLint configuration using eslint-plugin-autofix to enable autofix for no-debugger and no-unused-vars rules."},"warnings":[{"fix":"Update ESLint to >=8 and Node.js to >=18.","message":"v2.0.0 dropped support for ESLint <8 and Node.js <18. Upgrade to ESLint 8+ and Node 18+.","severity":"breaking","affected_versions":"<2.0.0"},{"fix":"Consider monitoring the repo for updates or using ESLint's built-in autofix.","message":"The plugin may not be actively maintained; check the repository for recent updates. Last release was v2.2.0 in 2024-09.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Always use 'autofix/<rule-name>' format.","message":"Rule names must be prefixed with 'autofix/' in the eslintrc rules object. Omitting the prefix will use the original ESLint rule without autofix.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Check the rule's documentation to see if it is fixable.","message":"The 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.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-plugin-autofix --save-dev' and ensure ESLint version is >=8.","cause":"eslint-plugin-autofix not installed or version incompatible with ESLint version.","error":"ESLint: Failed to load plugin 'autofix' declared in '.eslintrc'"},{"fix":"Verify that 'no-unused-vars' is a valid ESLint rule; the autofix plugin wraps most ESLint core rules.","cause":"The autofix rule name does not map to any existing rule in the plugin or the original ESLint rule does not exist.","error":"ESLint: Error while loading rule 'autofix/no-unused-vars': Rule 'no-unused-vars' is not defined in plugin 'autofix'."},{"fix":"Use 'import autofix from 'eslint-plugin-autofix'' instead of require.","cause":"Using CommonJS require in an ESM project (type: 'module' in package.json).","error":"ReferenceError: require is not defined in ES module scope"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}