When default exporting a Flow Enum, do not append semicolon (#8768)
* When default exporting a Flow Enum, do not append semicolon * Add changelog entry for #8768
This commit is contained in:
1 parent
f0285dc3d2
commit
bd8992d53b
3 files changed
+18
-2
No files matched your search
@@ -0,0 +1,15 @@
|
||||
#### Fix export default of Flow Enum ([#8768](https://github.com/prettier/prettier/pull/8768) by [@gkz](https://github.com/gkz))
|
||||
|
||||
Do not add a trailing semicolon if default exporting a Flow Enum.
|
||||
|
||||
<!-- prettier-ignore -->
|
||||
```jsx
|
||||
// Input
|
||||
export default enum B {}
|
||||
|
||||
// Prettier stable
|
||||
export default enum B {};
|
||||
|
||||
// Prettier master
|
||||
export default enum B {}
|
||||
```
|
||||
@@ -4064,7 +4064,8 @@ function printExportDeclaration(path, options, print) {
|
||||
decl.declaration.type !== "TSInterfaceDeclaration" &&
|
||||
decl.declaration.type !== "DeclareClass" &&
|
||||
decl.declaration.type !== "DeclareFunction" &&
|
||||
decl.declaration.type !== "TSDeclareFunction"
|
||||
decl.declaration.type !== "TSDeclareFunction" &&
|
||||
decl.declaration.type !== "EnumDeclaration"
|
||||
) {
|
||||
parts.push(semi);
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ export default enum B {}
|
||||
|
||||
export enum A {}
|
||||
|
||||
export default enum B {};
|
||||
export default enum B {}
|
||||
|
||||
================================================================================
|
||||
`;
|
||||
|
||||
Reference in new issue
Block a user