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(ts): include leading operator in TSUnionType
and TSIntersectionType
locations
#12757
fix(ts): include leading operator in TSUnionType
and TSIntersectionType
locations
#12757
Conversation
…nType` locations
packages/babel-parser/test/fixtures/typescript/type-alias/union-intersection/input.ts
Outdated
Show resolved
Hide resolved
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 = & number typescript 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
TSUnionType
andTSIntersectionType
nodes.