what is no-else-return supposed to do? #14097
Unanswered
JonFranchi
asked this question in
Q&A
Replies: 1 comment
-
I'm having the same issue here, decided to start using more eslint auto-fix, and just saw that issue today. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have some issues to clean up which showed up in the latest linter upgrade, but I can't tell if the results of --fix are buggy or intentional. It doesn't seem to match the description in the linter rule, but I can't find anybody else talking about it.
ex. 1:
Is fixed as:
ex. 2:
Is fixed as:
In the first one, why is it leaving the
if
block on the same line the other one ends?In the second one, same question, but this makes me question the definition of the rule which says:
That's not actually true here. We're short circuiting, then ensuring on not-guaranteed-thing is set, then proceeding with the code. The second conditional definitely cannot be placed outside the block. Though I agree it doesn't need to be chained to the previous conditional and works perfectly fine as it's own if block.
Any thoughts on this? The biggest thing is the fix leaving the conditional starting on the same line the previous one ends. That can't be deliberate, right?
Beta Was this translation helpful? Give feedback.
All reactions