lezer-parser/javascript

Support `import { default as name }`

Closed this issue · 3 comments

import { default as x } from 'x'

It has the same semantics as import x from 'x' but is an allowed way of writing. I saw this kind of code from some outputs of rollup:

import { default as default2 } from "eslint-plugin-antfu";

Current AST output:

Script
  ImportDeclaration
    import
    ImportGroup
      {
      String
        ⚠
      ⚠
    ⚠
  ExpressionStatement
    VariableName
      ⚠

Update: It seems export { default as name } from 'x' has this issue too.

This patch should help.

@marijnh can you tag a release with the fix?

I've tagged 1.4.9!