Skip to content

Commit

Permalink
docs: Add heading to justification explanation
Browse files Browse the repository at this point in the history
Places the documentation related to justifications (on comment directives) in its own section so it may be more easily found from the table of contents.

Fixes #16426
  • Loading branch information
maritaria committed Oct 16, 2022
1 parent 1692840 commit 3684887
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/src/user-guide/configuring/rules.md
Expand Up @@ -232,6 +232,10 @@ foo(); // eslint-disable-line example/rule-name
foo(); /* eslint-disable-line example/rule-name */
```

**Note:** Comments that disable warnings for a portion of a file tell ESLint not to report rule violations for the disabled code. ESLint still parses the entire file, however, so disabled code still needs to be syntactically valid JavaScript.

#### Documenting justification

Configuration comments can include descriptions to explain why the comment is necessary. The description must come after the configuration and needs to be separated from the configuration by two or more consecutive `-` characters. For example:

```js
Expand All @@ -245,8 +249,6 @@ console.log('hello');
console.log('hello');
```

**Note:** Comments that disable warnings for a portion of a file tell ESLint not to report rule violations for the disabled code. ESLint still parses the entire file, however, so disabled code still needs to be syntactically valid JavaScript.

### Using configuration files

To disable rules inside of a configuration file for a group of files, use the `overrides` key along with a `files` key. For example:
Expand Down

0 comments on commit 3684887

Please sign in to comment.