Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix non-idempotent formatting of function calls with complex type arg…
…uments (#12508) * Fix * Add TS tests * Add Flow tests * Add changelog
- Loading branch information
1 parent
1939f92
commit becb6c9
Showing
6 changed files
with
148 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
#### Fix non-idempotent formatting of function calls with complex type arguments (#12508 by @sosukesuzuki) | ||
|
||
<!-- prettier-ignore --> | ||
```tsx | ||
// Input | ||
const foo = | ||
doSomething<{ foo1: "foo1", foo2: "foo2", foo3: "foo3", foo4: "foo4", foo5: "foo5" }>(); | ||
|
||
// Prettier stable (first) | ||
const foo = | ||
doSomething<{ | ||
foo1: "foo1"; | ||
foo2: "foo2"; | ||
foo3: "foo3"; | ||
foo4: "foo4"; | ||
foo5: "foo5"; | ||
}>(); | ||
|
||
// Prettier stable (second) | ||
const foo = doSomething<{ | ||
foo1: "foo1"; | ||
foo2: "foo2"; | ||
foo3: "foo3"; | ||
foo4: "foo4"; | ||
foo5: "foo5"; | ||
}>(); | ||
|
||
// Prettier main | ||
const foo = doSomething<{ | ||
foo1: "foo1"; | ||
foo2: "foo2"; | ||
foo3: "foo3"; | ||
foo4: "foo4"; | ||
foo5: "foo5"; | ||
}>(); | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let emit = | ||
defineEmits<{ (event: "ready", canvas: HTMLCanvasElement): void; (event:"resize",canvas:HTMLCanvasElement):void; }>(); | ||
|
||
let abc = | ||
func<{a:2,b:3,d:78,e:9,f:8,g:7,h:6,i:5,j:4,k:3,l:2,m:1,n:0,o:9,p:8,q:7,r:6,s:5,t:4,u:3,v:2,w:1,x:0,y:9,z:8}>(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
let emit = | ||
defineEmits<{ (event: "ready", canvas: HTMLCanvasElement): void; (event:"resize",canvas:HTMLCanvasElement):void; }>(); | ||
|
||
let abc = | ||
func<{a:2,b:3,d:78,e:9,f:8,g:7,h:6,i:5,j:4,k:3,l:2,m:1,n:0,o:9,p:8,q:7,r:6,s:5,t:4,u:3,v:2,w:1,x:0,y:9,z:8}>(); |