Skip to content
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.

fix(rome_js_formatter): Union in mapped type #4100

Merged
merged 1 commit into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/rome_js_formatter/src/ts/types/union_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ impl FormatNodeRule<TsUnionType> for FormatTsUnionType {
| JsSyntaxKind::TS_TUPLE_TYPE_ELEMENT_LIST
| JsSyntaxKind::TS_TYPE_ASSERTION_ASSIGNMENT
| JsSyntaxKind::TS_TYPE_ARGUMENT_LIST
| JsSyntaxKind::TS_MAPPED_TYPE
)
)
}
Expand Down
4 changes: 2 additions & 2 deletions crates/rome_js_formatter/tests/specs/ts/type/union_type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ type Comments =
trailing type */

type A = [
/*leading comment with new line*/
/*leading comment with new line*/
A | B,
];

Expand Down Expand Up @@ -243,4 +243,4 @@ type GetChatsSagaEffects =
type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla =
| Fooo1000
| Baz2000
| BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong;
| BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong;
14 changes: 7 additions & 7 deletions crates/rome_js_formatter/tests/specs/ts/type/union_type.ts.snap
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/rome_formatter_test/src/snapshot_builder.rs
info:
test_file: ts/type/union_type.ts
info: "ts\\type\\union_type.ts"
---

# Input
Expand All @@ -21,7 +20,7 @@ type Comments =
trailing type */

type A = [
/*leading comment with new line*/
/*leading comment with new line*/
A | B,
];

Expand Down Expand Up @@ -253,6 +252,7 @@ type SuperLongTypeNameLoremIpsumLoremIpsumBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBlaBla =
| Fooo1000
| Baz2000
| BarLoooooooooooooooooooooooooooooooooooooooooooooooooLong;

```


Expand Down Expand Up @@ -377,10 +377,10 @@ const fooo: SomeThingWithShortMappedType<{

const fooo: SomeThingWithLongMappedType<{
[P in
| AAAAAAAAAAAAAAAAA
| BBBBBBBBBBBB
| CCCCCCCCCCCCCCCCCCCCC
| DDDDDDDDDDDDDDDDDDDDDDDDDDDDD]: number;
| AAAAAAAAAAAAAAAAA
| BBBBBBBBBBBB
| CCCCCCCCCCCCCCCCCCCCC
| DDDDDDDDDDDDDDDDDDDDDDDDDDDDD]: number;
}> = {};

export type A =
Expand Down