Skip to content

Latest commit

 

History

History
30 lines (20 loc) · 844 Bytes

no-unnecessary-await.md

File metadata and controls

30 lines (20 loc) · 844 Bytes

Disallow awaiting non-promise values

💼 This rule is enabled in the ✅ recommended config.

🔧 This rule is automatically fixable by the --fix CLI option.

The await operator should only be used on Promise values.

Fail

await await promise;
await [promise1, promise2];

Pass

await promise;
await Promise.allSettled([promise1, promise2]);