sindresorhus/eslint-plugin-unicorn

`no-single-promise-in-promise-methods`: Provide autofix for `const [foo] = await Promise.all([promise])`

Closed

#2,388 opened on Jun 22, 2024

 (1 comment) (3 reactions) (0 assignees)JavaScript (468 forks)user submission
enhancementhelp wanted

Repository metrics

Stars
 (5,022 stars)
PR merge metrics
 (Avg merge 1d 16h) (399 merged PRs in 30d)

Description

Description

In #2386 we are removing autofix and suggestions from Promise.all() since it returns an array, but we can add autofix for

const [foo] = await Promise.all([promise]);
[foo] = await Promise.all([promise]);
const foo = (await Promise.all([promise]))[0];

Contributor guide