sindresorhus/eslint-plugin-unicorn

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

Chiusa

#2388 aperta il 22 giu 2024

 (1 commento) (3 reazioni) (0 assegnatari)JavaScript (468 fork)user submission
enhancementhelp wanted

Metriche repository

Star
 (5022 stelle)
Metriche merge PR
 (Merge medio 4h 30m) (26 PR mergiate in 30 g)

Descrizione

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

Guida contributor