Skip to content

Commit d03a8bf

Browse files
maritarianzakas
andauthored
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 <[email protected]>
1 parent 886a038 commit d03a8bf

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -232,6 +232,10 @@ foo(); // eslint-disable-line example/rule-name
232232
foo(); /* eslint-disable-line example/rule-name */
233233
```
234234

235+
**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.
236+
237+
#### Comment descriptions
238+
235239
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:
236240

237241
```js
@@ -245,8 +249,6 @@ console.log('hello');
245249
console.log('hello');
246250
```
247251

248-
**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.
249-
250252
### Using configuration files
251253

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

0 commit comments

Comments
 (0)