You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix: capitalized-comments: Ignore consec. comments if first is invalid (#7835)
* Fix: capitalized-comments: Ignore consec. comments if first is invalid
Only applies when `ignoreConsecutiveComments` option is enabled.
* Adding "never" test case.
* Docs: Fix documentation for consecutive comments
* Docs: Clarify examples
Copy file name to clipboardexpand all lines: docs/rules/capitalized-comments.md
+15-6
Original file line number
Diff line number
Diff line change
@@ -56,7 +56,7 @@ Here are the supported object options:
56
56
*`ignorePattern`: A string representing a regular expression pattern of words that should be ignored by this rule. If the first word of a comment matches the pattern, this rule will not report that comment.
57
57
* Note that the following words are always ignored by this rule: `["jscs", "jshint", "eslint", "istanbul", "global", "globals", "exported"]`.
58
58
*`ignoreInlineComments`: If this is `true`, the rule will not report on comments in the middle of code. By default, this is `false`.
59
-
*`ignoreConsecutiveComments`: If this is `true`, the rule will not report on a comment which violates the rule, as long as the comment immediately follows a comment which is also not reported. By default, this is `false`.
59
+
*`ignoreConsecutiveComments`: If this is `true`, the rule will not report on a comment which violates the rule, as long as the comment immediately follows another comment. By default, this is `false`.
60
60
61
61
Here is an example configuration:
62
62
@@ -172,24 +172,33 @@ function foo(/* ignored */ a) {
172
172
173
173
#### `ignoreConsecutiveComments`
174
174
175
-
If the `ignoreConsecutiveComments` option is set to `true`, then comments which otherwise violate the rule will not be reported as long as they immediately follow a comment which did not violate the rule. This can be applied more than once.
175
+
If the `ignoreConsecutiveComments` option is set to `true`, then comments which otherwise violate the rule will not be reported as long as they immediately follow another comment. This can be applied more than once.
176
176
177
177
Examples of **correct** code with `ignoreConsecutiveComments` set to `true`:
// this comment is invalid, but only on this line.
199
+
// this comment does NOT get reported, since it is a consecutive comment.
200
+
```
201
+
193
202
### Using Different Options for Line and Block Comments
194
203
195
204
If you wish to have a different configuration for line comments and block comments, you can do so by using two different object configurations (note that the capitalization option will be enforced consistently for line and block comments):
0 commit comments