`eslint-` comments cause `lines-around-comment` rule to error
See original GitHub issue-
The version of ESLint you are using
1.8.0
-
What you did (the source code and ESLint configuration)
/* eslint-disable no-underscore-dangle */ this._values = values; this._values2 = true; /* eslint-enable no-underscore-dangle */
with the following configuration:
"lines-around-comment": [2, { "allowArrayStart": true, "allowBlockStart": true, "allowObjectStart": true, "beforeBlockComment": true, "beforeLineComment": true }],
-
The actual ESLint output complete with numbers
error Expected line before comment lines-around-comment
-
What you expected to happen instead
No error. I don’t think
lines-around-comment
should be enforced foreslint-enable
/eslint-disable
type comments. This follows with the fact thatno-inline-comments
ignoreseslint-disable-line
comments even when it’s enabled.
<bountysource-plugin>
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource. </bountysource-plugin>
Issue Analytics
- State:
- Created 8 years ago
- Reactions:2
- Comments:37 (33 by maintainers)
Top Results From Across the Web
lines-around-comment - ESLint - Pluggable JavaScript Linter
Rule Details This rule requires empty lines before and/or after comments. It can be enabled separately for both block ( /* ) and...
Read more >`eslint-` comments cause `lines-around-comment` rule to error
No error. I don't think lines-around-comment should be enforced for eslint-enable / eslint-disable type comments. This follows with the fact that no-inline- ...
Read more >Rule lines-around-comment - ESLint中文
This rule allows you to specify whether an empty line should be found before or after a comment. It can be enabled separately...
Read more >Is there any syntax to add additional info to an eslint-disable ...
You can add two dashes -- . According to the docs on using configuration comments: Configuration comments can include descriptions to ...
Read more >eslint-comments/no-unlimited-disable - mysticatea
eslint-disable directive-comments disable all rules by default. This may cause to overlook some ESLint warnings unintentionally. So you should specify the ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m working on this
Per TSC meeting, we decided that globally excluding comments has too many problems and we shouldn’t proceed down that path. We do think it’s useful to be able to exclude configuration comments from
lines-around-comments
, and have decided on adding anignorePattern
option to the rule that behaves the same as in https://github.com/eslint/eslint/issues/6077.