When default exporting a Flow Enum, do not append semicolon#8768
Merged
sosukesuzuki merged 2 commits intoprettier:masterfrom Jul 16, 2020
gkz:flow-enums-export-default
Merged
When default exporting a Flow Enum, do not append semicolon#8768sosukesuzuki merged 2 commits intoprettier:masterfrom gkz:flow-enums-export-default
sosukesuzuki merged 2 commits intoprettier:masterfrom
gkz:flow-enums-export-default
Conversation
fisker
approved these changes
Jul 16, 2020
thorn0
approved these changes
Jul 16, 2020
alexander-akait
approved these changes
Jul 16, 2020
sosukesuzuki
approved these changes
Jul 16, 2020
Member
|
@gkz Do you know will this format into invalid code? Prettier pr-8768 --parser flow
--no-semiInput: export default enum B {}
[].forEach(() => 0)Output: export default enum B {}
;[].forEach(() => 0) |
Collaborator
Author
|
That behavior is fine, the semicolon does not create invalid code, it was just not necessary. |
Collaborator
Author
|
Looks like we do the same thing for classes: => |
Member
|
Okay, thanks. |
Member
|
@fisker That's a documented behavior: https://prettier.io/docs/en/rationale.html#semicolons |
Member
|
I know that, I was afraid that |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a bug fix (missed this during initial support). Like function declarations and class declarations, Flow Enum declarations should not be trailed by a semicolon.
changelog_unreleased/*/pr-XXXX.mdfile followingchangelog_unreleased/TEMPLATE.md.✨Try the playground for this PR✨