Auto fix no-unneeded-ternary
changes code behavior
#8507
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
rule
Relates to ESLint's core rules
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.
The following code (line 3) is considered an error by the
no-unneeded-ternary
rule.When
--fix
is used, it is corrected to code that has different behavior. See:What did you expect to happen?
Parens should probably be added in this situation. This code would have maintained the same behavior:
Related issue: standard/standard#866
The text was updated successfully, but these errors were encountered: