Skip to content

Conversation

@henryqdineen
Copy link
Collaborator

When a TSUnionType has an elementType of TSUnionType the brackets would only end up on the last member of the union (e.g number | string[] instead of (number | string)[]). Parsers seem to wrap the TSUnionType in a TSParenthesizedType which would get around this issue but in codemods and other scenarios where nodes are built by hand it could be easy to make this mistake.

It's possible that this is just a bug in ast-types and a TSUnionType should not be a valid elementType.

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.

1 participant