Skip to content

Commit

Permalink
Add clarification about eslint-enable rule:
Browse files Browse the repository at this point in the history
See #15662
  • Loading branch information
dosisod committed Mar 6, 2022
1 parent 57b8a57 commit 0f26525
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/user-guide/configuring/rules.md
Expand Up @@ -144,6 +144,8 @@ console.log('bar');
/* eslint-enable no-alert, no-console */
```

**Note:** `/* esline-enable */` without any specific rules will cause all errors to be re-enabled. You will have to re-specify the errors you wish to keep disabled.

To disable rule warnings in an entire file, put a `/* eslint-disable */` block comment at the top of the file:

```js
Expand All @@ -160,6 +162,14 @@ You can also disable or enable specific rules for an entire file:
alert('foo');
```

To ensure that a rule is always applied (regardless of any future enable/disable lines):

```js
/* eslint no-alert: "off" */

alert('foo');
```

To disable all rules on a specific line, use a line or block comment in one of the following formats:

```js
Expand Down

0 comments on commit 0f26525

Please sign in to comment.