Missing Await (ARCH3029)
Key typescript.async.missing-await · Severity warning · Category async
Using a promise-returning call in a boolean/value position (if, assignment, return) without await is a bug: the promise object is always truthy and the real result is never awaited.
Incorrect
Section titled “Incorrect”async function ensureAccess(userId: string): Promise<void> { if (hasPermission(userId)) { // promise is always truthy grant(userId); }}Correct
Section titled “Correct”async function ensureAccess(userId: string): Promise<void> { if (await hasPermission(userId)) { grant(userId); }}Await the promise-returning call before using its value.