-
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
babel-parser throws syntax error for import string names with flow plugin #12209
Copy link
Copy link
Closed
Closed
Copy link
Labels
area: flowoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser
Description
Bug Report
- I would like to work on a fix!
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
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
area: flowoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issueA closed issue/PR that is archived due to age. Recommended to make a new issuepkg: parser