Skip to content

Add support for Promise.allSettled() and Promise.any() #367

@ota-meshi

Description

@ota-meshi

Description

I want the plugin to add support for Promise.allSettled() and Promise.any().
Those Promise features were added in ES2020 and later, but this plugin doesn't seem to support them yet.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/allSettled
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/any

Steps to Reproduce

/* eslint promise/valid-params: error */

Promise.all([p1, p2]); // OK
Promise.all(p1, p2); // NG

Promise.any([p1, p2]); // OK
Promise.any(p1, p2); // NG: False negative

Promise.allSettled([p1, p2]); // OK
Promise.allSettled(p1, p2); // NG: False negative

Online DEMO

Expected behavior: [What you expect to happen]

I expect to be warned even if I use the new API.

Actual behavior: [What actually happens]

The plugin does not support new APIs.

Versions

[Please fill this in if you are submitting a bug report]

  • Node version: v18.4.0
  • ESLint version: v8.24.0
  • eslint-plugin-promise version: v6.0.1

Additional Information

[Any additional information, configuration or data that might be necessary to
reproduce the issue]

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions