Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix #7920 - do not add comma for explicit inexact object with indexer…
… property (#7923) * 7920 run tests for trailingComma:es5 option as well * 7920 example of wrong behavior - comma is always added at the end of the inexact object type * 7920 add test cases for trailingComma: 'all' * 7920 fix - do not force trailing comma on explicit inexact type if it has indexer or no properties * 7920 add changelog
- Loading branch information
1 parent
7047fad
commit 964230d
Showing
6 changed files
with
588 additions
and
5 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,52 @@ | ||
#### Do not add comma for explicit inexact object with indexer property or no properties ([#7923](https://github.com/prettier/prettier/pull/7923) by [@DmitryGonchar](https://github.com/DmitryGonchar)) | ||
|
||
<!-- prettier-ignore --> | ||
```jsx | ||
// Input | ||
type T = { | ||
a: number, | ||
..., | ||
} | ||
|
||
type T = { | ||
[string]: number, | ||
..., | ||
} | ||
|
||
type T = { | ||
// comment | ||
..., | ||
} | ||
|
||
// Prettier stable | ||
type T = { | ||
a: number, | ||
... | ||
} | ||
|
||
type T = { | ||
[string]: number, | ||
..., | ||
} | ||
|
||
type T = { | ||
// comment | ||
..., | ||
} | ||
|
||
// Prettier master | ||
type T = { | ||
a: number, | ||
... | ||
} | ||
|
||
type T = { | ||
[string]: number, | ||
... | ||
} | ||
|
||
type T = { | ||
// comment | ||
... | ||
} | ||
``` |
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.