💻
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
import { type default as Potato } from 'somewhere';
repl repro
Configuration file name
No response
Configuration
N/A: this shows up even in the REPL.
Current and expected behavior
Current behavior: Babel errors on this, with the following output:
> 1 | import { type default as Potato } from 'somewhere';
| ^
Expected behavior: this should parse! See this TS playground for an example.
Note that this is specific to the type default as Binding form: using import { type namedExport } from 'somewhere' parses fine, even if and as you stack multiple of those, including along with named value imports.
Environment
Babel version: 7.17.11 (reproducible anywhere)
Possible solution
Looks like this "just" needs to update the parser to understand that this is valid syntax as of TypeScript 4.5.
Additional context
No response
💻
How are you using Babel?
Other (Next.js, Gatsby, vue-cli, ...)
Input code
repl repro
Configuration file name
No response
Configuration
N/A: this shows up even in the REPL.
Current and expected behavior
Current behavior: Babel errors on this, with the following output:
Expected behavior: this should parse! See this TS playground for an example.
Note that this is specific to the
type default as Bindingform: usingimport { type namedExport } from 'somewhere'parses fine, even if and as you stack multiple of those, including along with named value imports.Environment
Babel version: 7.17.11 (reproducible anywhere)
Possible solution
Looks like this "just" needs to update the parser to understand that this is valid syntax as of TypeScript 4.5.
Additional context
No response