File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change @@ -569,6 +569,12 @@ namespace ts.formatting {
569
569
return childKind !== SyntaxKind . JsxClosingElement ;
570
570
case SyntaxKind . JsxFragment :
571
571
return childKind !== SyntaxKind . JsxClosingFragment ;
572
+ case SyntaxKind . IntersectionType :
573
+ case SyntaxKind . UnionType :
574
+ if ( childKind === SyntaxKind . TypeLiteral ) {
575
+ return false ;
576
+ }
577
+ // falls through
572
578
}
573
579
// No explicit rule for given nodes so the result will follow the default value argument
574
580
return indentByDefault ;
Original file line number Diff line number Diff line change
1
+ /// <reference path='fourslash.ts' />
2
+
3
+ //// type NumberAndString = {
4
+ //// a: number
5
+ //// } & {
6
+ //// b: string
7
+ //// };
8
+ ////
9
+ //// type NumberOrString = {
10
+ //// a: number
11
+ //// } | {
12
+ //// b: string
13
+ //// };
14
+ ////
15
+ //// type Complexed =
16
+ //// Foo &
17
+ //// Bar |
18
+ //// Baz;
19
+
20
+
21
+ format . document ( ) ;
22
+ verify . currentFileContentIs ( `type NumberAndString = {
23
+ a: number
24
+ } & {
25
+ b: string
26
+ };
27
+
28
+ type NumberOrString = {
29
+ a: number
30
+ } | {
31
+ b: string
32
+ };
33
+
34
+ type Complexed =
35
+ Foo &
36
+ Bar |
37
+ Baz;` ) ;
You can’t perform that action at this time.
0 commit comments