-
Notifications
You must be signed in to change notification settings - Fork 142
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
False positive for await-async-utils #732
Comments
Thanks for reporting @iantocristian! This is a regression introduced in the last version indeed. |
Pinging @patriscus in case you can check this issue. |
I'm sorry to see that I've caused some issues 👀 I had a quick look: The first example seems to be related to the I very quickly added a safeguard to not push empty strings into the array, and the tests seem to pass (need to verify it a bit more thoroughly). The second example is more complex in my eyes. This code fails even before my commit - my theory is that since we push wrapper names, we don't really check scopes. So in the example provided: const waitWithAct = async (timeout) => {
const fn = async () => await wait(timeout);
await act(fn);
}; We will push I could be wrong, though. I will try to provide a PR for the first issue by tomorrow's EOD. About the second example, I don't know if it makes sense to do it in this issue. It seems to me that this is a separate topic; hence I wanted to ask if it should be extracted into a separate issue. I will for sure not be able to solve it within the next 2 days, and I'm not available for a couple of days (vacation). I can, however, pick it up after I'm back (would just give a quick ping to let you know). Please let me know what you think @Belco90. |
Thanks for addressing this issue! |
@patriscus Better to address the issues in separate PRs! |
🎉 This issue has been resolved in version 5.10.2 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 6.0.0-alpha.15 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Have you read the Troubleshooting section?
Yes
Plugin version
v5.10.1
ESLint version
v8.33.0
Node.js version
v18.12.1
package manager and version
npm 9.4.2
Operating system
macOS Ventura 13.2
Bug description
This appears to be a regression introduced with the latest patch release, v5.10.1. Not present in v5.10.0.
False positive rule
await-async-utils
triggered by inline async function definition on other variables and/or definitions.Promise returned from x wrapper over async util must be handled
but x is not a function.Steps to reproduce
This code triggers a false positive on
expectedValue
:Rewriting the inline async function fixes the false positive:
Another case of false positive, this results in false positives reported for
mock
andjest.fn
:Error output/screenshots
No response
ESLint configuration
Rule(s) affected
testing-library/await-async-utils
Do you want to submit a pull request to fix this bug?
No
The text was updated successfully, but these errors were encountered: