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

Commit

Permalink
fix(rome_js_formatter): Union in mapped type
Browse files Browse the repository at this point in the history
## Summary

Fixes #4074
  • Loading branch information
MichaReiser committed Dec 23, 2022
1 parent c4eb1d5 commit b7f6f44
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
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
10 changes: 5 additions & 5 deletions crates/rome_js_formatter/tests/specs/ts/type/union_type.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type Comments =
trailing type */

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

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

0 comments on commit b7f6f44

Please sign in to comment.