-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Docs: Overhaul no-floating-promise messages and docs #8088
Comments
Since #7008 was added to the 8 milestone for tracking, adding this as well. I think we'll really need to have good docs to make sure folks don't misuse this. |
Btw, referencing #7008 & nodejs/node#51292 & reduxjs/redux-toolkit#4102: we should definitely mention strategies for frameworks/libraries to mark Promises as safe (or not expose them). |
Note: #8573 has a good suggestion:
|
Before You File a Documentation Request Please Confirm You Have Done The Following...
Suggested Changes
Right now,
@typescript-eslint/no-floating-promises
logs quite a mouthful for its messages:So much text! Longer messages are less likely to be read by users - especially "error" (or "warning") messages like this one.
In addition, it's also missing the point that storing the Promise in a variable is considered an acceptable workaround by the rule (assuming you have unused variable detection enabled). #8046 is an example of a discussion asking about that.
This is a nuanced area. See replies to: https://twitter.com/flybayer/status/1469098848958222337, https://twitter.com/threepointone/status/1471458830626299911, https://twitter.com/nandafyi/status/1736164705448956388, and other threads from searching on
no-floating-promises
). I think we should rework the rule a bit to coach/encourage developers into treating the nuance with care:Affected URL(s)
https://typescript-eslint.io/rules/no-floating-promises
The text was updated successfully, but these errors were encountered: