Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix mistransformation of type unions with comments #355

Merged
merged 5 commits into from Feb 1, 2022

Conversation

JohnnyMorganz
Copy link
Owner

Fixes #351,
Also fixes loss of comments when hanging a type union

export type ReactNode =
React_Element<any>
| ReactPortal
-- | ReactText

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why does the ReactText comment get indented when the other comment don’t?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ReactText is an in-line comment in the type union

The other comments aren't part of the type union, they are just statement level comments, so they aren't indented.

If you moved the other two comments before the last union type, it would be indented

@JohnnyMorganz JohnnyMorganz merged commit 27317d0 into master Feb 1, 2022
@JohnnyMorganz JohnnyMorganz deleted the type-union-comments branch February 1, 2022 20:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

mistransformation when comment inside type union
2 participants