← All scars

scar-004 · scar

Missing await on async call

An async function was called without await, so the code used a Promise instead of the real value.

mediumcaptured Oct 10from commit 35bb7d8never repeated

Before and after

Before · the mistake
1const user = loadUser(id)
After · the rule
1const user = await loadUser(id)

How it’s detected

=\s*(?!await\b)(load|fetch)[A-Z]\w*\(

Times it came back

This mistake has not been repeated. The rule is working.