-
Notifications
You must be signed in to change notification settings - Fork 242
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
no-if rule doesn't work in many cases #1026
Comments
Ironically I was looking at this code the other day when writing this new rule (iirc) and thinking "wait, isn't that check incorrect...?" 😅 |
I've "fixed" this by creating a new rule to replace |
🎉 This issue has been resolved in version 26.1.0-next.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This was closed in v26.1.0 but the bot didn't pick it up 😅 |
it's due to rebase merge, so the bot lost track of the connection between the commit that landed in the PR that closed this issue and the one that landed on |
The
jest/no-if
rule has a bug which results in it failing to find conditions in many cases.This pops from the stack whenever a call expression ends yet this only adds to the stack when specific call expression start.
This results in more items being popped off than pushed.
Example:
The inner function in the second example causes the stack to be popped off one too many times and so by the time it arrives at the condition, the stack is empty when it shouldn't be.
I believe there are also other cases where this can occur as when debugging I often see it attempting to pop off the stack several times despite the stack being empty.
The text was updated successfully, but these errors were encountered: