Bug: [await-thenable] Don't flag values of an unconstrained type parameter #10311
Closed
4 tasks done
Labels
accepting prs
Go ahead, send a pull request that resolves this issue
bug
Something isn't working
locked due to age
Please open a new issue if you'd like to say more. See https://typescript-eslint.io/contributing.
package: eslint-plugin
Issues related to @typescript-eslint/eslint-plugin
Before You File a Bug Report Please Confirm You Have Done The Following...
Playground Link
https://typescript-eslint.io/play/#ts=5.6.2&fileType=.ts&code=IYZwngdgxgBAZgV2gFwJYHsIwO4CdgAOBAprgDwAqAfABQBuwANgsQFwwUCUMA3gFAwYuYsgS4swbMFTIYDZsQDcfAL5A&eslintrc=N4KABGBEBOCuA2BTAzpAXGUEKQAIBcBPABxQGNoBLY-AWhXkoDt8B6AQwHd3K78ALRE3YAjJOiiJo0APbRI4MAF8QSoA&tsconfig=N4KABGBEDGD2C2AHAlgGwKYCcDyiAuysAdgM6QBcYoEEkJemy0eAcgK6qoDCAFutAGsylBm3TgwAXxCSgA&tokens=false
Repro Code
ESLint Config
tsconfig
Expected Result
The
await value
shouldn't be reported on. We don't know thatT
is or isn't a Promise/Thenable. I'd like to be able to use theawait
just in case it is.Actual Result
On the
await value
:Additional Info
For a slightly more realistic reproduction, consider a function that
await
s the result of calling a function for a generic value:Somewhat related: #8301, where it was noted that the rule intentionally ignores
any
andunknown
values because there's no guarantee they aren't a Promise.💖
The text was updated successfully, but these errors were encountered: