DenoDDeno
Powered by
CodyCC
Denoβ€’4y agoβ€’
6 replies
CodyC

Lint for if you forgot to `await` a Promise?

If you have async methods that you call for their side effects, it's easy to forget to
await
await
them.

Is there a lint rule that I can enable for that? (Sort of like Rust's rules about unused Results?)

ex:

async myFn() {
    // code

    // oops, I forgot to await:
    doThing()

    // more code
    // fails at runtime because doThing()
    // hasn't finished yet.

}
async myFn() {
    // code

    // oops, I forgot to await:
    doThing()

    // more code
    // fails at runtime because doThing()
    // hasn't finished yet.

}
Deno banner
DenoJoin
Chat about Deno, a modern runtime for JavaScript and TypeScript.
20,934Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

Is there a way to lint check unnecessary `await`s?
CodyCCCodyC / help
3y ago
await promise does not yield control
Northern SavageNNorthern Savage / help
2y ago
how to check if a promise has been resolved
#  πŸͺ·ε€ͺγƒΌ##  πŸͺ·ε€ͺγƒΌ / help
2y ago
how to specify giving error or warning for a lint rule?
MajorAmariMMajorAmari / help
3y ago