Skip to content

Commit

Permalink
Parse string epxort names by default (moduleStringNames)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolo-ribaudo committed Apr 22, 2021
1 parent cf45eef commit 9370d4c
Show file tree
Hide file tree
Showing 28 changed files with 4 additions and 22 deletions.
1 change: 0 additions & 1 deletion packages/babel-parser/src/parser/statement.js
Expand Up @@ -2089,7 +2089,6 @@ export default class StatementParser extends ExpressionParser {
// https://tc39.es/ecma262/#prod-ModuleExportName
parseModuleExportName(): N.StringLiteral | N.Identifier {
if (this.match(tt.string)) {
this.expectPlugin("moduleStringNames");
const result = this.parseLiteral<N.StringLiteral>(
this.state.value,
"StringLiteral",
Expand Down
@@ -0,0 +1,3 @@
{
"sourceType": "module"
}

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

@@ -1,8 +1,5 @@
{
"sourceType": "module",
"plugins": [
"moduleStringNames",
"flow"
],
"plugins": ["flow"],
"throws": "A string literal cannot be used as an imported binding.\n- Did you mean `import { \"foo\" as foo }`? (1:9)"
}

0 comments on commit 9370d4c

Please sign in to comment.