-
-
Notifications
You must be signed in to change notification settings - Fork 790
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
Add no-floating-promises @typescript-eslint rule #2452
Comments
Probably it's good to add that one, but to prevent issues where you forget to await a promise, we actually need We are currently using that in the blitz monorepo like so: https://github.com/blitz-js/blitz/blob/canary/.eslintrc.js#L55-L66 Probably it's a good idea to add to our blitz eslint config for users. It will add two new dependencies,
|
I think this definitely should be set to warn |
I've now looked into this and maybe I should rewrite this issue to reflect that we need to add the const foo = async () => {
return bar()
} and changing this to |
@lksnmnn sounds good to me to update the issue |
Updated the issue to reflect our discussion. |
For whoever wants to work on this, our eslint config is here: https://github.com/blitz-js/blitz/tree/canary/packages/eslint-config You'll need to add the correct dependencies to that package as well as the config file. |
@flybayer Number 5? Can I hop on this one? |
@meehawk sorry for the delay, of course! Btw, you don't have to wait for confirmation if it's labeled |
What do you want and why?
Adding the above mentioned rule, would catch floating promises and thus helps devs like me to not forget to
await
my promises.Discussion:
The ESLint rule
require-await
does something similar but cannot gather insights about functions imported from other files and thus flags false positives like:Possible implementation(s)
Additional context
Add any other context or screenshots about the feature request here.
The text was updated successfully, but these errors were encountered: