Skip to content

fix(linter/no-single-promise-in-promise-methods): preserve array structure in fixer for Promise.all#17128

Merged
graphite-app[bot] merged 1 commit intomainfrom
c/12-19-fix_linter_preserve_array_structure_in_no-single-promise-in-promise-methods_fixer_for_promise.all
Dec 19, 2025
Merged

fix(linter/no-single-promise-in-promise-methods): preserve array structure in fixer for Promise.all#17128
graphite-app[bot] merged 1 commit intomainfrom
c/12-19-fix_linter_preserve_array_structure_in_no-single-promise-in-promise-methods_fixer_for_promise.all

Conversation

@camc314
Copy link
Contributor

@camc314 camc314 commented Dec 19, 2025

Fixes #17120

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Dec 19, 2025
Copy link
Contributor Author

camc314 commented Dec 19, 2025


How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent hot fixes, skip the queue and merge this PR next

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.

@camc314 camc314 changed the title fix(linter): preserve array structure in no-single-promise-in-promise-methods fixer for Promise.all fix(linter/no-single-promise-in-promise-methods): preserve array structure in fixer for Promise.all Dec 19, 2025
@camc314 camc314 force-pushed the c/12-19-fix_linter_preserve_array_structure_in_no-single-promise-in-promise-methods_fixer_for_promise.all branch 2 times, most recently from c175af7 to eec5e70 Compare December 19, 2025 13:06
@camc314 camc314 marked this pull request as ready for review December 19, 2025 13:07
Copilot AI review requested due to automatic review settings December 19, 2025 13:07
@camc314 camc314 self-assigned this Dec 19, 2025
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label Dec 19, 2025
Copy link
Contributor Author

camc314 commented Dec 19, 2025

Merge activity

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 of await 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.all preserves array structure while Promise.any and Promise.race maintain single-value semantics

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 19, 2025

CodSpeed Performance Report

Merging #17128 will not alter performance

Comparing c/12-19-fix_linter_preserve_array_structure_in_no-single-promise-in-promise-methods_fixer_for_promise.all (eec5e70) with main (09e8e31)

Summary

✅ 4 untouched
⏩ 41 skipped1

Footnotes

  1. 41 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports.

@graphite-app graphite-app bot force-pushed the c/12-19-fix_linter_preserve_array_structure_in_no-single-promise-in-promise-methods_fixer_for_promise.all branch from eec5e70 to aba2795 Compare December 19, 2025 13:13
@graphite-app graphite-app bot merged commit aba2795 into main Dec 19, 2025
20 checks passed
@graphite-app graphite-app bot deleted the c/12-19-fix_linter_preserve_array_structure_in_no-single-promise-in-promise-methods_fixer_for_promise.all branch December 19, 2025 13:18
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 19, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: no-single-promise-in-promise-methods incorrectly transforms fields expecting arrays

2 participants