Indent comment indentation: Comments can align with previous/next lines of code even if whitespace in between
See original GitHub issueTell us about your environment
- ESLint Version: 4.13.1 (via online demo)
- Node Version: N/A
- npm Version: N/A
What parser (default, Babel-ESLint, etc.) are you using?
Default parser
Please show your full configuration:
Configuration
{
"rules": {
"indent": ["error", 4]
}
}
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
if (foo) {
// blah
statement();
}
What did you expect to happen?
3:1 - Expected indentation of 4 spaces but found 0. (indent)
What actually happened? Please include the actual, raw output from ESLint.
No lint error.
The bug (as I see it) is that the indent rule has a tolerance for comments to match the indentation of the previous line, that of the next line, or the “actual correct location”. However, I think this should only apply if there actually is code on the immediately previous or next lines, rather than code that is separated by one or more lines of whitespace.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:6 (6 by maintainers)
Top GitHub Comments
Thanks for following up! I haven’t had a chance to look into this; please take a look if you are interested.
On Sat, May 19, 2018, 19:54 Scott Stern notifications@github.com wrote:
Working on this.