Skip to content

Commit

Permalink
Check importAttributes and importAssertions
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Feb 15, 2024
1 parent 950a377 commit c0dafaa
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/babel-parser/src/plugins/typescript/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,10 @@ export default (superClass: ClassWithMixin<typeof Parser, IJSXParserMixin>) =>

// For compatibility to estree we cannot call parseLiteral directly here
node.argument = super.parseExprAtom() as N.StringLiteral;
if (this.hasPlugin("importAttributes")) {
if (
this.hasPlugin("importAttributes") ||
this.hasPlugin("importAssertions")
) {
node.options = null;
}
if (this.eat(tt.comma)) {
Expand Down

0 comments on commit c0dafaa

Please sign in to comment.