This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 885
await-promise is incompatible with the Promise/A+ spec #3512
Labels
Comments
You can configure what the rule should treat as promise: https://palantir.github.io/tslint/rules/await-promise/ |
What's the motivation for |
The rule doesn't check for assignability / compatibility. It just checks the name. |
You mean it literally checks that the type's name is that string? |
Yep, it checks the name of every base type and recurses into union and intersection types. |
adidahiya
added a commit
that referenced
this issue
Nov 28, 2017
How's this for a docs update to clarify the issue? #3519 |
adidahiya
added a commit
that referenced
this issue
Nov 28, 2017
Thanks for the clarifications @ajafff, @adidahiya. Cheers, |
HyphnKnight
pushed a commit
to HyphnKnight/tslint
that referenced
this issue
Apr 9, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Bug Report
TypeScript code being linted
Actual behavior
Expected behavior
The error is triggered because the object awaited is a Funfix Future which does not inherit from
Promise
.According to the Promises/A+ specification the
Promise
class is NOT required forawait
to work. You only need a "thenable" object, meaning a type that implementsthen
with the described behavior.In TypeScript this is exposed as
PromiseLike
:Possibly related: #3381
Please make this check look for
PromiseLike
and not forPromise
.Thanks,
The text was updated successfully, but these errors were encountered: