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
Operator-Linebreak Default Option Behaves Differently When Option Is Actually Specified #7459
Comments
Thanks for the report. I was going to say that this is a bug, but based on the source code it appears to be intentional. I'm not sure why, though. If it is intentional, then I agree that the documentation should point it out. edit: It looks like this was introduced in 4ade378 |
Yeah, it definitely feels buggy. And even the docs in that commit seem unclear on what the behavior should be. |
I figured it out: it's not that there's a bug in the rule, it's that the default configuration has overrides for I made a PR to update the docs at #7726. |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
A
B
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
"after" (default) requires linebreaks to be placed after the operator (except for the ternary operator characters ? and :)
Based on the docs, I would expect this code to pass with both configs.
What actually happened? Please include the actual, raw output from ESLint.
If you use config B, the line is flagged as an error. Config A passes as expected.
I think this is really a doc issue. It should be more clear that the
after
option and thedefault
behavior are not interchangeable.The text was updated successfully, but these errors were encountered: