Bug Report
Current behavior
babel-parser throws syntax error Unexpected token (1:9) with moduleStringNames plugin and flow plugin. (REPL)
This happens on import only, export works fine. (REPL)
Input Code
import { "foo" as foo } from "module-a";
Expected behavior
No syntax error is thrown.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
Call parse directly.
const code = `import { "foo" as foo } from "module-a";`;
require("@babel/parser").parse(code, {
sourceType: "module",
plugins: ["moduleStringNames", "flow"],
});
Environment
Possible Solution
Additional context
Found from working on prettier/prettier#9408
Bug Report
Current behavior
babel-parser throws syntax error
Unexpected token (1:9)withmoduleStringNamesplugin andflowplugin. (REPL)This happens on
importonly,exportworks fine. (REPL)Input Code
Expected behavior
No syntax error is thrown.
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
Call
parsedirectly.Environment
Possible Solution
Additional context
Found from working on prettier/prettier#9408