fix(linter/no-single-promise-in-promise-methods): preserve array structure in fixer for Promise.all#17128
Conversation
How to use the Graphite Merge QueueAdd either label to this PR to merge it via the merge queue:
You must have a Graphite account in order to use the merge queue. Sign up using this link. An organization admin has enabled the Graphite Merge Queue in this repository. Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue. This stack of pull requests is managed by Graphite. Learn more about stacking. |
c175af7 to
eec5e70
Compare
Merge activity
|
There was a problem hiding this comment.
Pull request overview
This PR fixes the auto-fixer for the no-single-promise-in-promise-methods linter rule to correctly preserve array structure when fixing Promise.all calls with single-element arrays.
Key Changes:
- Modified the fixer to replace
await Promise.all([x])with[await x]instead ofawait x, preserving the array return type - Changed from tracking a boolean flag to capturing the await expression's span for more precise code replacement
- Added differentiated handling:
Promise.allpreserves array structure whilePromise.anyandPromise.racemaintain single-value semantics
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
CodSpeed Performance ReportMerging #17128 will not alter performanceComparing Summary
Footnotes
|
eec5e70 to
aba2795
Compare

Fixes #17120