Skip to content

fix(formatter): Do not consider rest param as simple#17354

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-25-fix_formatter_do_not_consider_rest_param_as_simple
Dec 26, 2025
Merged

fix(formatter): Do not consider rest param as simple#17354
graphite-app[bot] merged 1 commit intomainfrom
12-25-fix_formatter_do_not_consider_rest_param_as_simple

Conversation

@leaysgur
Copy link
Member

@leaysgur leaysgur commented Dec 25, 2025

Closes #17269

Update: Changed parent branch to main

@leaysgur leaysgur requested a review from Dunqing as a code owner December 25, 2025 07:12
@github-actions github-actions bot added A-formatter Area - Formatter C-bug Category - Bug labels Dec 25, 2025
Copy link
Member Author

leaysgur commented Dec 25, 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.

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 25, 2025

CodSpeed Performance Report

Merging #17354 will not alter performance

Comparing 12-25-fix_formatter_do_not_consider_rest_param_as_simple (99b68ec) with main (7c3dae3)1

Summary

✅ 38 untouched
⏩ 7 skipped2

Footnotes

  1. No successful run was found on main (4df8063) during the generation of this report, so 7c3dae3 was used instead as the comparison base. There might be some changes unrelated to this pull request in this report.

  2. 7 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.

@leaysgur leaysgur force-pushed the 12-25-fix_formatter_do_not_consider_rest_param_as_simple branch from ff59dde to d53c16d Compare December 25, 2025 07:25
@leaysgur leaysgur changed the base branch from 12-25-fix_formatter_complete_is_complex_type_arguments to graphite-base/17354 December 25, 2025 09:47
@leaysgur leaysgur force-pushed the 12-25-fix_formatter_do_not_consider_rest_param_as_simple branch from d53c16d to 99b68ec Compare December 25, 2025 09:47
@leaysgur leaysgur force-pushed the graphite-base/17354 branch from 77f526c to 4df8063 Compare December 25, 2025 09:47
@leaysgur leaysgur changed the base branch from graphite-base/17354 to main December 25, 2025 09:47
@Dunqing Dunqing added the 0-merge Merge with Graphite Merge Queue label Dec 26, 2025
Copy link
Member

Dunqing commented Dec 26, 2025

Merge activity

Closes #17269

Update: Changed parent branch to `main`
Copilot AI review requested due to automatic review settings December 26, 2025 03:32
@graphite-app graphite-app bot force-pushed the 12-25-fix_formatter_do_not_consider_rest_param_as_simple branch from 99b68ec to 745bc5d Compare December 26, 2025 03:32
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.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@graphite-app graphite-app bot merged commit 745bc5d into main Dec 26, 2025
20 checks passed
@graphite-app graphite-app bot deleted the 12-25-fix_formatter_do_not_consider_rest_param_as_simple branch December 26, 2025 03:38
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 26, 2025
graphite-app bot pushed a commit that referenced this pull request Feb 2, 2026
#18835)

Closes #16177

## Summary
- Adds a regression test for issue #16177

## Details

The issue was that member chains would incorrectly break when a function expression had rest parameters:

**Before (incorrect):**
```ts
jest
  .spyOn(Element.prototype, "getBoundingClientRect")
  .mockImplementation(function (this: Element, ...args) {
```

**After (correct - matches Prettier):**
```ts
jest.spyOn(Element.prototype, "getBoundingClientRect").mockImplementation(function (
  this: Element,
  ...args
) {
```

This was fixed by #17354, which ensures the `rest` parameter is not considered "simple", allowing the member chain to stay hugged while function parameters break vertically.

🤖 Generated with [Claude Code](https://claude.ai/code)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-formatter Area - Formatter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

formatter: Diff with Prettier on named functions as arguments to higher-order functions.

3 participants