Contradictions in no-unneeded-ternary documentation #10872
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
documentation
Relates to ESLint's documentation
rule
Relates to ESLint's core rules
I'm not sure if this is the right place to raise this issue, but the documentation for the
no-unneeded-ternary
rule seems to have a mistake.At one point, it mentions that a
||
should be used when the middle operand of the ternary is the same as the first:Later, however, it lists something seemingly identical to this as an example of correct code:
In my project, I was given a
no-unneeded-ternary
error for using this type of code, so the documentation seems to have an error. Either way, the documentation seems to list this sort of construct as both correct and incorrect, so one of those is probably in error.The text was updated successfully, but these errors were encountered: