-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Closed
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
Description
Before You File a Bug Report Please Confirm You Have Done The Following...
- I have tried restarting my IDE and the issue persists.
- I have updated to the latest version of the packages.
- I have searched for related issues and found none that matched my issue.
- I have read the FAQ and my problem is not listed.
Playground Link
Repro Code
const maybePromise = Math.random() ? Promise.resolve() : 1;
await maybePromise; // rule does not report
Promise.all([maybePromise]); // rule reports
export {};ESLint Config
{
"rules": {
"@typescript-eslint/await-thenable": "error"
}
}tsconfig
Expected Result
The rule should not report.
Actual Result
The rule reports on passing maybePromise into Promise.all.
Additional Info
In #11267, @ronami added support for non-promise values passed to aggregator methods.
However, this now introduces an inconsistency:
- The rule correctly does not report when
awaiting something that might be aPromise. - However, the rule wrongly reports when passing something that might be a
Promiseinto a promise aggregator function.
branko-d, kirillgroshkov, boris-petrov, danewilson, FloEdelmann and 6 more
Metadata
Metadata
Assignees
Labels
accepting prsGo ahead, send a pull request that resolves this issueGo ahead, send a pull request that resolves this issuebugSomething isn't workingSomething isn't workingpackage: eslint-pluginIssues related to @typescript-eslint/eslint-pluginIssues related to @typescript-eslint/eslint-plugin
{ "compilerOptions": { "strictNullChecks": true } }