-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Unexpected no-floating-promises eslint error for MutationActionCreatorResult #4508
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
Comments
@Rovack Is this still an issue? |
Yes, I just tried updating the dependencies and it doesn't look like anything's changed, with versions:
|
Maybe you also need to add the RTKQ export? '@typescript-eslint/no-floating-promises': [
'error',
{
allowForKnownSafePromises: [
{ from: 'package', name: 'SafePromise', package: '@reduxjs/toolkit' },
+ { from: 'package', name: 'SafePromise', package: '@reduxjs/toolkit/query' },
+ { from: 'package', name: 'SafePromise', package: '@reduxjs/toolkit/query/react' },
],
},
], |
Unfortunately it still doesn't work with the addition of those lines. |
I'm seeing this lint report on all Promises, too. Not sure if I'm setting things up wrong or what. Minimal reproduction in https://github.com/typescript-eslint/examples/pull/20/files: git clone https://github.com/typescript-eslint/examples
gh pr checkout 20
npm i
cd packages/redux-toolkit-floating-promises
npm run lint
I tried downgrading from the latest |
@JoshuaKGoldberg did you also try to add the other two packages? |
Ah, I did, I just neglected to check them in. Same issue. Added in typescript-eslint/examples@185fa5c. |
We have the following code:
Understandably, we're getting a @typescript-eslint/no-floating-promises error.
Based on this comment, we've therefore configured our eslintrc with the following:
However, the eslint error isn't disappearing. Are we missing something, or does this just not work for this case for some reason?
Versions
The text was updated successfully, but these errors were encountered: