{"id":19843,"library":"eslint-plugin-no-autofix","title":"eslint-plugin-no-autofix","description":"ESLint plugin that wraps any rule to disable its autofix behavior, allowing rules to report warnings without automatically fixing them. Current stable version is 2.1.0, released September 2024. Requires Node >= 18 and ESLint >= 8. The plugin supports all ESLint core rules and third-party plugin rules by simply prefixing the rule name with 'no-autofix/'. It is particularly useful for teams that want to enforce certain rules (like prefer-const) but avoid automatic code modifications that might conflict with other tools or team conventions. Unlike alternatives (e.g., using eslint --no-fix), this provides per-rule granularity.","status":"active","version":"2.1.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-no-autofix","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-no-autofix","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-no-autofix","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required at runtime to apply the plugin","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since v2.0.0; CJS require will fail on Node >= 18.","wrong":"const noAutofix = require('eslint-plugin-no-autofix')","symbol":"plugin (default export)","correct":"import noAutofix from 'eslint-plugin-no-autofix'"},{"note":"Flat config was introduced in ESLint v9; the old .eslintrc style is deprecated.","wrong":"module.exports = {\n  plugins: ['no-autofix'],\n  rules: { 'no-autofix/prefer-const': 'error' }\n}","symbol":"flat config (ESLint v9 compatible)","correct":"import noAutofix from 'eslint-plugin-no-autofix';\nexport default [\n  { plugins: { 'no-autofix': noAutofix }, rules: { 'no-autofix/prefer-const': 'error' } }\n]"},{"note":"The named export 'rules' gives direct access to the rule factory, but the recommended way is to use the default export as a plugin object.","wrong":"import { noAutofix } from 'eslint-plugin-no-autofix'","symbol":"rules object (advanced usage)","correct":"import { rules } from 'eslint-plugin-no-autofix'"}],"quickstart":{"code":"// Install: npm i eslint-plugin-no-autofix -D\n\n// eslint.config.js (flat config, ESLint v9+)\nimport noAutofix from 'eslint-plugin-no-autofix';\n\nexport default [\n  {\n    plugins: {\n      'no-autofix': noAutofix\n    },\n    rules: {\n      // Disable the original rule\n      'prefer-const': 'off',\n      // Enable no-autofix version\n      'no-autofix/prefer-const': 'error',\n      // Works with plugin rules too\n      'react/jsx-indent': 'off',\n      'no-autofix/react/jsx-indent': 'error'\n    }\n  }\n];","lang":"javascript","description":"Demonstrates how to configure eslint-plugin-no-autofix with flat config, disabling the original rule and enabling the no-autofix variant for core and plugin rules."},"warnings":[{"fix":"Upgrade to Node >= 18 and ESLint >= 8. If using .eslintrc, stay on v1.x or migrate to flat config.","message":"v2.0.0 dropped support for ESLint < 8 and Node < 18. Flat config is now expected.","severity":"breaking","affected_versions":">=2.0.0"},{"fix":"Always set the original rule to 'off' when using the no-autofix variant to avoid duplicate warnings.","message":"The plugin only disables the autofix modifier; the rule still reports the same warnings. If you want to completely disable a rule, use 'off' on the original, not 'no-autofix/rule' alone.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Add 'no-autofix' to the plugins array in your ESLint config.","message":"When using the old .eslintrc style, plugin must be listed in 'plugins' array, and the rule prefix must be 'no-autofix/'. Omitting the plugin declaration will cause an error.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Migrate to eslint.config.js with flat config as shown in Quickstart.","message":"The .eslintrc format (JSON, YAML, JS) is deprecated in ESLint v9. Use flat config (eslint.config.js) instead.","severity":"deprecated","affected_versions":">=2.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-no-autofix --save-dev' and verify the spelling in your config.","cause":"Plugin not installed or misspelled.","error":"Error: Failed to load plugin 'no-autofix' declared in 'plugins' array of my config: Cannot find module 'eslint-plugin-no-autofix'"},{"fix":"Use import syntax (ESM) or downgrade to v1.x with require() and Node < 18.","cause":"Using CJS require() with ESM-only package (v2+).","error":"Error: Cannot find module 'eslint-plugin-no-autofix' require() of ES Module not supported"},{"fix":"Make sure to add 'no-autofix' to the plugins list in your ESLint config.","cause":"Rule prefix is correct but plugin not registered in 'plugins' array.","error":"ESLint: Definition for rule 'no-autofix/prefer-const' was not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}