# es/no-promise-any

disallow Promise.any function and AggregateError class

  • ✅ 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.any function
  • AggregateError class

# 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. } })
Now loading...

# 📚 References