Skip to content

Commit

Permalink
docs: Add clarification about eslint-enable (#15680)
Browse files Browse the repository at this point in the history
* docs: Add clarification about eslint-enable rule:

Fixes #15662

* Update docs/user-guide/configuring/rules.md

* Update docs/user-guide/configuring/rules.md

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
  • Loading branch information
3 people authored Mar 9, 2022
1 parent 385c9ad commit d2255db
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/user-guide/configuring/rules.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,8 @@ console.log('bar');
/* eslint-enable no-alert, no-console */
```

**Note:** `/* eslint-enable */` without any specific rules listed will cause all disabled rules to be re-enabled.

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 never 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 d2255db

Please sign in to comment.