question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`eslint-` comments cause `lines-around-comment` rule to error

See original GitHub issue
  1. The version of ESLint you are using

    1.8.0

  2. 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
    }],
    
  3. The actual ESLint output complete with numbers

    error Expected line before comment lines-around-comment

  4. What you expected to happen instead

    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-comments ignores eslint-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:closed
  • Created 8 years ago
  • Reactions:2
  • Comments:37 (33 by maintainers)

github_iconTop GitHub Comments

2reactions
albertocommented, Feb 24, 2017

I’m working on this

2reactions
nzakascommented, Jul 7, 2016

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 an ignorePattern option to the rule that behaves the same as in https://github.com/eslint/eslint/issues/6077.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found