diff --git a/docs/src/user-guide/configuring/rules.md b/docs/src/user-guide/configuring/rules.md index e504a53198e..cd3ee979bf8 100644 --- a/docs/src/user-guide/configuring/rules.md +++ b/docs/src/user-guide/configuring/rules.md @@ -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 @@ -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: