Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
docs: Add heading to justification explanation (#16430)
* docs: Add heading to justification explanation

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

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

Co-authored-by: Nicholas C. Zakas <nicholas@humanwhocodes.com>
  • Loading branch information
maritaria and nzakas committed Oct 31, 2022
1 parent 886a038 commit d03a8bf
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.

#### Comment descriptions

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 d03a8bf

Please sign in to comment.