You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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:
So, it would be nice if we could mark those promises with some kind of branded type to them to signal to eslint that these promises can be handled, but don't need to.
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 the allow 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):
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 🙂
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: