New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ending line with breaks indent linting rules #9878
Ending line with breaks indent linting rules #9878
Comments
Hi, thanks for the report. I noticed you put "all" as your ESLint version, but I assume you haven't actually tried this on every ESLint version. Could you be more specific about what version you're using? |
Sorry, I meant to update that before submitting. What that was meant to indicate is that it's apparently present in all recent versions. I've tested 4.6.1 and the latest. |
FWIW, I noticed that while trying to upgrade from 4.15.0 to 4.16.0. Same behavior on 4.17.0. Not sure if this is related, but this also fail since 4.16.0 : const Foo = () => {
return (
<div>Some text
<span>yolo</span> //error Expected indentation of 8 spaces but found 12 indent
</div>
)
} Not the prettiest code but I don't think this line should be flagged as badly indented. |
I have the same problem. For now I find this stylistic compromise acceptable for my style guide:
|
This fixes a bug in the `indent` rule where a line comparison with the end of a token would use the end location of any trailing whitespace in the token, rather than the location of the last non-whitespace character in the token. This behavior went against user intuition for tokens with trailing whitespace.
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
eslint, 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?
The code above should pass indent linting rules.
What actually happened? Please include the actual, raw output from ESLint.
It generated the following error:
Removing two spaces generates the same error, inverted:
However, moving the non-breaking space to the same line as the anchor tag, with 14 spaces, does not generate an error. It appears the line ending with the non-breaking space is breaking linting on the next line, at least partially (no other errors are generated).
This works:
The text was updated successfully, but these errors were encountered: