fix(ts): include leading operator in TSUnionType and TSIntersectionType locations#12757
Conversation
…nType` locations
|
This pull request is automatically built and testable in CodeSandbox. To see build info of the built libraries, click here or the icon next to each commit SHA. Latest deployment of this branch, based on commit 0ad3952:
|
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/39567/ |
|
there is one more case that should be taken into account: type M = | number
type M = & numbertypescript in this case generates union type to and babel does not, unless this should be done in separate PR |
|
I think we should align to TypeScript and |
|
@JLHwung yes, should I open a new PR for that? |
|
@fedeci yeah let's do a new pr |
|
Thanks! |
We save the location of the leading operator token and use that to start
TSUnionTypeandTSIntersectionTypenodes.