[Babel 8]: wrap the TSImportType's argument within a TSLiteralType#17046
[Babel 8]: wrap the TSImportType's argument within a TSLiteralType#17046JLHwung merged 4 commits intobabel:mainfrom
Conversation
|
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/58553 |
|
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. |
19144b2 to
ff5f666
Compare
| node.argument = super.parseExprAtom() as any; | ||
| } else { | ||
| if (process.env.BABEL_8_BREAKING) { | ||
| node.argument = this.tsParseLiteralTypeNode(); |
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?
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.
f07269f to
3c05933
Compare
|
Amended the last commit for Babel 7 test changes. |
…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
Uh oh!
There was an error while loading. Please reload this page.