Pattern: Missing await
on async
function call
Issue: -
Promises that are never awaited can cause unexpected behavior because they may be scheduled to execute at an unexpected time.
Examples of incorrect code for this rule:
function writeToDb() {
// synchronously write to DB
}
writeToDb();
Examples of correct code for this rule:
async function writeToDb() {
// asynchronously write to DB
}
writeToDb(); // <- note we have no await here but probably the user intended to await on this!