💼 This rule is enabled in the ✅ recommended
config.
🔧💡 This rule is automatically fixable by the --fix
CLI option and manually fixable by editor suggestions.
Passing a single-element array to Promise.all()
, Promise.any()
, or Promise.race()
is likely a mistake.
const foo = await Promise.all([promise]);
const foo = await Promise.any([promise]);
const foo = await Promise.race([promise]);
const promise = Promise.all([nonPromise]);
const foo = await promise;
const promise = Promise.resolve(nonPromise);
const foo = await Promise.all(promises);
const foo = await Promise.any([promise, anotherPromise]);
const [{value: foo, reason: error}] = await Promise.allSettled([promise]);