eslint-plugin-disable-autofix
Advanced tools
Comparing version 5.0.0 to 5.0.1
{ | ||
"name": "eslint-plugin-disable-autofix", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"description": "Disable autofix for ESLint rules without turning them off", | ||
@@ -5,0 +5,0 @@ "main": "./index.js", |
# eslint-plugin-disable-autofix | ||
Disable autofix for ESLint rules and prevent them from being formatted without | ||
having to turn them off | ||
having to turn them off. | ||
@@ -10,3 +10,3 @@ ## Usage | ||
```shell | ||
```sh | ||
npm i -D eslint-plugin-disable-autofix | ||
@@ -17,2 +17,67 @@ ``` | ||
Import and include `disable-autofix` in the `plugins` object | ||
Add prefix `disable-autofix/` to the rule and disable the original | ||
```ts | ||
import disableAutofix from 'eslint-plugin-disable-autofix'; | ||
export default [ | ||
{ | ||
plugins: { | ||
'disable-autofix': disableAutofix, | ||
}, | ||
rules: { | ||
'prefer-const': 'off', | ||
'disable-autofix/prefer-const': 'warn', | ||
}, | ||
}, | ||
]; | ||
``` | ||
Using 3rd-party Rules | ||
```ts | ||
import disableAutofix from 'eslint-plugin-disable-autofix'; | ||
import react from 'eslint-plugin-react'; | ||
export default [ | ||
{ | ||
plugins: { | ||
'disable-autofix': disableAutofix, | ||
react, | ||
}, | ||
rules: { | ||
'react/jsx-indent': 'off', | ||
'disable-autofix/react/jsx-indent': 'error', | ||
}, | ||
}, | ||
]; | ||
``` | ||
Using Scoped Rules | ||
```ts | ||
import disableAutofix from 'eslint-plugin-disable-autofix'; | ||
import htmlEslint from '@html-eslint/eslint-plugin'; | ||
export default [ | ||
{ | ||
plugins: { | ||
'disable-autofix': disableAutofix, | ||
'@html-eslint': htmlEslint, | ||
}, | ||
rules: { | ||
'@html-eslint/require-closing-tags': 'off', | ||
'disable-autofix/@html-eslint/require-closing-tags': [ | ||
'error', | ||
{ selfClosing: 'always' }, | ||
], | ||
}, | ||
}, | ||
]; | ||
``` | ||
### Configure Legacy | ||
Include `disable-autofix` in the `eslintrc` plugins array | ||
@@ -32,3 +97,3 @@ | ||
Use 3rd-party rules | ||
Using 3rd-party Rules | ||
@@ -45,3 +110,3 @@ ```js | ||
Use scoped rules | ||
Using Scoped Rules | ||
@@ -48,0 +113,0 @@ ```js |
7570
121