With no-else-return activated:
The final else is considered a violation -- which makes technical sense given the implementation, but seems contrary to the intent of the rule (to eliminate superfluous else statements). The final else block is meaningful here despite the preceding "returning" if because it's also still an alternative of the first case, which did not return. Handling that distinction might be more trouble than it's worth, since grammatically, "else if" is not a concept, it's just "else statement" where the statement happens to be an "if", but I figured I'd ask just in case it's a viable refinement after all.
For anyone else running into this who'd like to keep the rule on -- this is how the no-else-return rule would prefer to see that logic expressed:
It's not that bad, just a bit unnatural when compared to the standard else-if pattern.
The text was updated successfully, but these errors were encountered: