[Babel 8]: wrap the TSImportType's argument within a TSLiteralType#17046
Merged
JLHwung merged 4 commits intobabel:mainfrom Jan 9, 2025
Merged
[Babel 8]: wrap the TSImportType's argument within a TSLiteralType#17046JLHwung merged 4 commits intobabel:mainfrom
JLHwung merged 4 commits intobabel:mainfrom
Conversation
Collaborator
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/58553 |
11 tasks
Contributor
Author
|
The CI error is not related to this PR as it is failing on main, too. It seems that the CI error is caused by nodejs/node#56350, I will investigate. |
liuxingbaoyu
approved these changes
Jan 9, 2025
19144b2 to
ff5f666
Compare
Comment on lines
+560
to
+563
| node.argument = super.parseExprAtom() as any; | ||
| } else { | ||
| if (process.env.BABEL_8_BREAKING) { | ||
| node.argument = this.tsParseLiteralTypeNode(); |
Member
There was a problem hiding this comment.
For invalid things like import(1), would it be better to parse the argument as a tsParseLiteralTypeNode rather than an expression?
Contributor
Author
There was a problem hiding this comment.
That was my first thought, but then I realized that the tsParseLiteralTypeNode does not handle template literals. It seems that typescript-eslint adopted this approach, too. I will revise this PR.
nicolo-ribaudo
approved these changes
Jan 9, 2025
f07269f to
3c05933
Compare
Contributor
Author
|
Amended the last commit for Babel 7 test changes. |
This was referenced Mar 14, 2025
laine-hallot
pushed a commit
to laine-hallot/uwu-parser
that referenced
this pull request
Mar 31, 2025
…abel#17046) * breaking: wrap the TSImportType's argument within a TSLiteralType * update AST fixtures * polish: parse argument as a non-conditional type on invalid input
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.
Uh oh!
There was an error while loading. Please reload this page.