-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
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: generatorpkg: parser
Description
Bug Report
- I would like to work on a fix!
Current behavior
Current babel-parser cannot parse Flow's indexed access types with Syntax Error Unexpected token, expected "]" (1:15)
- REPL.
Input Code
type Foo = Bar['foo'];
Expected behavior
Returns the AST like below:
interface IndexedAccessType {
objectType: Type;
indexType: LiteralType;
}
Babel Configuration (babel.config.js, .babelrc, package.json#babel, cli command, .eslintrc)
Use parser directly.
Environment
- Babel version(s): current
main
Possible Solution
Additional context
I could not find the feature from changelog on Flow repo but it seems to be supported by current Flow. See prettier/prettier#10594.
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: generatorpkg: parser