comment at end of line confuses indent's handling of ternary operator #9729
Labels
accepted
There is consensus among the team that this change meets the criteria for inclusion
archived due to age
This issue has been archived; please open a new issue for any further discussion
bug
ESLint is working incorrectly
indent
Relates to the `indent` rule
rule
Relates to ESLint's core rules
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? babel-eslint
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
What did you expect to happen?
1
to be indented at the same level as2
What actually happened? Please include the actual, raw output from ESLint.
The source code above is formatted according to
eslint --fix
.indent
wants to indent the1
at the same level as thereturn
statement. Removing the// comment
after the?
clearsindent
's confusion and it does put1
at the same indent level as2
.Putting the
?
on the next line also works around the problem.The text was updated successfully, but these errors were encountered: