# es/no-promise-any
disallow
Promise.anyfunction andAggregateErrorclass
- ✅ The following configurations enable this rule:
plugin:es/no-new-in-esnext
This rule reports ES2021 Promise.any (opens new window) as errors.
This proposal includes the following two:
Promise.anyfunctionAggregateErrorclass
# Examples
⛔ Examples of incorrect code for this rule:
/*eslint es/no-promise-any: error */
const p = Promise.any(promises).catch(error => {
if (error instanceof AggregateError) {
// Do something.
}
})