-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Use a branded Promise type for always-resolved Promises #4101
Comments
4 tasks
Sure, happy to take that PR :) I will say that the promise / error handling logic inside |
4 tasks
Btw I just edited the OP to make it clear what the changes in a user's ESLint config would be. Only realized after the fact I was never clear on that. Sorry 🙂 |
This was referenced Jun 4, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Coming over from typescript-eslint/typescript-eslint#7008 (comment): there is a known annoyance with the @typescript-eslint/no-floating-promises lint rule that it flags the Promises created by
createAsyncThunk
as "floating" if not handled, despite those Promises being known "safe" ones that never resolve. There's no way for the lint rule to know that these Promises are safe.That issue tracks adding an
allow
option to the lint rule that would let users allowlist these Promises. But in order to help with RTK, the known safe Promises would need some kind of specific type that can be added to the rule's allowlist. +1 to @phryneas's suggestion:We're up for adding in
allow
on our end if you're up for adding that branded type here! Is that something you're up for? Even if this issue is marked as blocked on us implementing theallow
option, as long as that's the only blocker we're good to go.I'd be happy to contribute the actual code change to RTK myself if you think it's doable for a first-timer. 😄
Edit: to be clear, this is roughly what users would be able to specify in their ESLint config once typescript-eslint/typescript-eslint#7008 is resolved (pending naming bikeshedding):
The text was updated successfully, but these errors were encountered: