sindresorhus / eslint-plugin-unicorn

More than 100 powerful ESLint rules
MIT License
4.19k stars 361 forks source link

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

Open fisker opened 3 months ago

fisker commented 3 months ago

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];
sindresorhus commented 2 months ago

Accepted