False positive for no-useless-return #7477
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
patch candidate
This issue may necessitate a patch release in the next few days
rule
Relates to ESLint's core rules
So I decided to give a try to the new rule
no-useless-return
and I stumbled on what looks to me like too much of goodness.Here is a minimal example to illustrate the issue (actual code is here: https://github.com/fasttime/JScrewIt/blob/b3cce7dbc33628c184a1d39bf827c5b5bb52877e/src/lib/encoder-base.js#L363).
Granted, there are plenty of ways to get rid of the expressionless
return;
, but it seems unfair to call it useless when the next statement would potentially return something different.The text was updated successfully, but these errors were encountered: