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
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.

}
Was this page helpful?