eslint-plugin-disable-autofix
raw JSON → 6.1.1 verified Sat Apr 25 auth: no javascript
ESLint plugin that disables autofix for specific rules without turning them off entirely, allowing rules to report but not auto-fix. Version 6.1.1 supports ESLint 9 flat config exclusively, with proxy-based lazy loading for improved performance. Key differentiators: requires no manual prefix handling in flat config, automatically wraps rules to prevent autofix, and includes a `configure()` helper for easy setup. Active development, frequent releases.
Common errors
error Error: Cannot find module 'eslint-plugin-disable-autofix' ↓
cause Package not installed or not found in node_modules.
fix
Run
npm install eslint-plugin-disable-autofix --save-dev. error Error: Failed to load plugin 'disable-autofix': Cannot find module 'eslint/use-at-your-own-risk' ↓
cause Outdated version of the plugin that used fragile filesystem paths.
fix
Update to v6.1.1+ (npm update eslint-plugin-disable-autofix).
error Error: Rule 'no-autofix' is not defined in 'disable-autofix' plugin ↓
cause Using legacy rule name 'no-autofix' without proper prefix or missing plugin in config.
fix
Ensure the plugin is added to
plugins and use 'disable-autofix/no-autofix' as the rule key. Warnings
breaking Version 5.0+ requires ESLint 9 (flat config only); not compatible with .eslintrc or legacy config. ↓
fix Migrate to flat config (eslint.config.js) or stay on v4.x for legacy ESLint 8 support.
deprecated The old `no-autofix` rule configuration is deprecated in favor of `configure()` helper. ↓
fix Use `configure({ rules: ['rule-name'] })` instead of manually setting `'disable-autofix/no-autofix'`.
gotcha The plugin only works with ESLint 9 flat config; attempts to use with legacy config will silently fail to disable autofix. ↓
fix Ensure eslint.config.js is used and eslint >=9.0.0 is installed.
gotcha When using `createPlugin()`, you must prefix rule names with the plugin name, e.g. `'plugin-name/rule-name'`, unless you set `mode: 'prefixed'` explicitly. ↓
fix Use the `configure` helper to automatically add prefixes.
Install
npm install eslint-plugin-disable-autofix yarn add eslint-plugin-disable-autofix pnpm add eslint-plugin-disable-autofix Imports
- plugin wrong
const plugin = require('eslint-plugin-disable-autofix')correctimport plugin from 'eslint-plugin-disable-autofix' - configure wrong
import { configure } from 'eslint-plugin-disable-autofix/configure'correctimport { configure } from 'eslint-plugin-disable-autofix' - createPlugin wrong
import { createPlugin } from 'eslint-plugin-disable-autofix/utils'correctimport { createPlugin } from 'eslint-plugin-disable-autofix'
Quickstart
// eslint.config.js
import plugin from 'eslint-plugin-disable-autofix';
import js from '@eslint/js';
export default [
js.configs.recommended,
{
plugins: {
'disable-autofix': plugin,
},
rules: {
'disable-autofix/no-autofix': ['error', { rules: ['no-unused-vars', 'semi'] }],
},
},
];