-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix: no-useless-return
false positive on conditionals (fixes #7477)
#7482
Conversation
@not-an-aardvark, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mysticatea to be a potential reviewer. |
LGTM |
|
||
// FIXME: Re-add this case (removed due to https://github.com/eslint/eslint/issues/7481): | ||
// https://github.com/eslint/eslint/blob/261d7287820253408ec87c344beccdba2fe829a4/tests/lib/rules/no-useless-return.js#L308-L329 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you!
You are always faster than me. 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What is the purpose of this pull request? (put an "X" next to item)
[x] Bug fix (template)
See #7477
What changes did you make? (Give an overview)
This ensures that if a
return
statement has an argument, and it's on the same code path as another return statement, the first return statement is not considered to be a useless return.Is there anything you'd like reviewers to focus on?
Nothing in particular.