Skip to content

Commit

Permalink
feat(docs): update readme
Browse files Browse the repository at this point in the history
  • Loading branch information
chiefmikey committed May 29, 2024
1 parent 318e8eb commit 0b41fbd
Showing 1 changed file with 69 additions and 4 deletions.
73 changes: 69 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,18 +1,83 @@
# 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.

## Usage

### Install

```shell
```sh
npm i -D eslint-plugin-disable-autofix
```

### Configure

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

Add prefix `disable-autofix/` to the rule and disable the original
Expand All @@ -27,7 +92,7 @@ module.exports = {
};
```

Use 3rd-party rules
Using 3rd-party Rules

```js
module.exports = {
Expand All @@ -39,7 +104,7 @@ module.exports = {
};
```

Use scoped rules
Using Scoped Rules

```js
module.exports = {
Expand Down

0 comments on commit 0b41fbd

Please sign in to comment.