eslint-plugin-unicorn icon indicating copy to clipboard operation
eslint-plugin-unicorn copied to clipboard

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

Open fisker opened this issue 1 year ago • 1 comments

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

fisker avatar Jun 22 '24 11:06 fisker

Accepted

sindresorhus avatar Jul 24 '24 22:07 sindresorhus