-
Notifications
You must be signed in to change notification settings - Fork 55
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
prefer-early-return doesn't work when there is a variable #314
Open
2 tasks done
Comments
This also doesn't work:
|
miluoshi
added a commit
to miluoshi/web-configs
that referenced
this issue
Feb 8, 2024
…s the last one in function body Sometimes we assign a conditions used in "if" test to a variable before "if" statement. In such case it's not the only statement in the block, but it should be detected anyway. closes Shopify#314
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Overview
When extracting the
if
condition into a variable, the rule is suddenly satisfied.Not sure if it's a bug or not, but this feel like it could be at least improved (yet I don't know if it's really feasible)
Examples:
The following is considered warning
yet, the following is not
Checklist
The text was updated successfully, but these errors were encountered: