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
"no-mixed-operators" always outputs errors in pairs of two #8051
Comments
This seems like a bug. Thanks for the report! |
Actually, this is intentional.
|
@mysticatea Wouldn't showing a single warning at the first operator suffice? |
I will not oppose it. However, this rule warns consecutive 2 operators on AST, so it might be at far locations on source code text if the expression is complex. It was the reason that I made 2 warnings. |
Makes sense. Either way is fine, though I was initially confused by the double error. |
I think this is the correct behavior as well. Perhaps we should update the docs to mention this? |
Update docs for `no-mixed-operators` to clarify that a pair of errors will be triggered for each pair of mixed consecutive operators used. Fixes eslint#8051.
Update docs for `no-mixed-operators` to clarify that a pair of errors will be triggered for each pair of mixed consecutive operators used. Fixes eslint#8051.
Update docs for `no-mixed-operators` to clarify that a pair of errors will be triggered for each pair of mixed consecutive operators used. Fixes eslint#8051.
Update docs for `no-mixed-operators` to clarify that a pair of errors will be triggered for each pair of mixed consecutive operators used. Fixes eslint#8051.
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
One error about mixed operators.
What actually happened? Please include the actual, raw output from ESLint.
Two errors about mixed operators, one for each operator:
Is this expected behavior? It seems there is no case where this rule emits a single error, since by definition "mixing" operators requires 2 operators. It would be more intuitive to me if a single error was emitted.
The text was updated successfully, but these errors were encountered: