Skip to content

Latest commit

 

History

History
34 lines (20 loc) · 1003 Bytes

no-await-in-promise-methods.md

File metadata and controls

34 lines (20 loc) · 1003 Bytes

Disallow using await in Promise method parameters

💼 This rule is enabled in the ✅ recommended config.

💡 This rule is manually fixable by editor suggestions.

Using await on promises passed as arguments to Promise.all(), Promise.allSettled(), Promise.any(), or Promise.race() is likely a mistake.

Fail

Promise.all([await promise, anotherPromise]);

Promise.allSettled([await promise, anotherPromise]);

Promise.any([await promise, anotherPromise]);

Promise.race([await promise, anotherPromise]);

Pass

Promise.all([promise, anotherPromise]);

Promise.allSettled([promise, anotherPromise]);

Promise.any([promise, anotherPromise]);

Promise.race([promise, anotherPromise]);