sindresorhus / eslint-plugin-unicorn

More than 100 powerful ESLint rules

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rule proposal: `no-await-in-promise-methods`

Clement398 opened this issue · comments

Description

Disallow using await in Promise method parameters.

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]);

Additional Info

No response

It's edited, thanks for the suggestion.