Skip to content

fix(formatter): wrongly added an indentation for an union type when there is a leading line comment#17252

Merged
graphite-app[bot] merged 1 commit intomainfrom
12-22-fix_formatter_wrongly_added_an_indentation_for_an_union_type_when_there_is_a_leading_line_comment
Dec 22, 2025
Merged

fix(formatter): wrongly added an indentation for an union type when there is a leading line comment#17252
graphite-app[bot] merged 1 commit intomainfrom
12-22-fix_formatter_wrongly_added_an_indentation_for_an_union_type_when_there_is_a_leading_line_comment

Conversation

@Dunqing
Copy link
Member

@Dunqing Dunqing commented Dec 22, 2025

close: #16902

The case below's output is incorrect, but it's not related to this issue, and was fixed in #17254
Input

console.log(
  <
    // comment
    string | number | undefined
  >0
);

Expect output:

console.log(
  <
    // comment
    string | number | undefined
  >0
);

Actual output

console.log(<
    // comment
    string | number | undefined
  >0);

Copy link
Member Author

Dunqing commented Dec 22, 2025

@codspeed-hq
Copy link

codspeed-hq bot commented Dec 22, 2025

CodSpeed Performance Report

Merging #17252 will not alter performance

Comparing 12-22-fix_formatter_wrongly_added_an_indentation_for_an_union_type_when_there_is_a_leading_line_comment (39a5ee2) with main (ab43454)1

Summary

✅ 38 untouched
⏩ 7 skipped2

Footnotes

  1. No successful run was found on 12-22-test_formatter_move_react_hooks_related_tests_to_a_same_folder (5dfff90) during the generation of this report, so main (ab43454) 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.

@graphite-app
Copy link
Contributor

graphite-app bot commented Dec 22, 2025

Merge activity

…here is a leading line comment (#17252)

close: #16902

The case below's output is incorrect, but it's not related to this issue, and was fixed in #17254
Input
```ts
console.log(
  <
    // comment
    string | number | undefined
  >0
);
```
Expect output:
```ts
console.log(
  <
    // comment
    string | number | undefined
  >0
);
```

Actual output
```ts
console.log(<
    // comment
    string | number | undefined
  >0);
```
@graphite-app graphite-app bot force-pushed the 12-22-test_formatter_move_react_hooks_related_tests_to_a_same_folder branch from 5dfff90 to 9e4ab39 Compare December 22, 2025 09:06
@graphite-app graphite-app bot force-pushed the 12-22-fix_formatter_wrongly_added_an_indentation_for_an_union_type_when_there_is_a_leading_line_comment branch from 39a5ee2 to def4ec1 Compare December 22, 2025 09:06
graphite-app bot pushed a commit that referenced this pull request Dec 22, 2025
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Dec 22, 2025
Base automatically changed from 12-22-test_formatter_move_react_hooks_related_tests_to_a_same_folder to main December 22, 2025 09:15
@graphite-app graphite-app bot merged commit def4ec1 into main Dec 22, 2025
21 checks passed
@graphite-app graphite-app bot deleted the 12-22-fix_formatter_wrongly_added_an_indentation_for_an_union_type_when_there_is_a_leading_line_comment branch December 22, 2025 09:17
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 comment in Generic Types

1 participant