-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Flow: Print trailing comma in type parameters when `--trailing-comma=…
…es5` (#14085)
- Loading branch information
Showing
18 changed files
with
1,338 additions
and
187 deletions.
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,40 @@ | ||
#### [BREAKING] Print trailing comma in type parameters and tuple types when `--trailing-comma=es5` (#14086, #14085 by @fisker) | ||
|
||
<!-- prettier-ignore --> | ||
```js | ||
// Input | ||
type Foo = [ | ||
{ | ||
from: string, | ||
to: string, | ||
}, // <- 1 | ||
]; | ||
type Foo = Promise< | ||
| { ok: true, bar: string, baz: SomeOtherLongType } | ||
| { ok: false, bar: SomeOtherLongType }, // <- 2 | ||
>; | ||
|
||
// Prettier stable | ||
type Foo = [ | ||
{ | ||
from: string, | ||
to: string, | ||
} // <- 1 | ||
]; | ||
type Foo = Promise< | ||
| { ok: true, bar: string, baz: SomeOtherLongType } | ||
| { ok: false, bar: SomeOtherLongType } // <- 2 | ||
>; | ||
|
||
// Prettier main | ||
type Foo = [ | ||
{ | ||
from: string, | ||
to: string, | ||
}, // <- 1 | ||
]; | ||
type Foo = Promise< | ||
| { ok: true, bar: string, baz: SomeOtherLongType } | ||
| { ok: false, bar: SomeOtherLongType }, // <- 2 | ||
>; | ||
``` |
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
Oops, something went wrong.