Skip to content

An exported TSImportEqualsDeclaration should be wrapped in an ExportNamedDeclaration instead of having .isExport = true #4130

Closed
@bradzacher

Description

@bradzacher

Code from #4129

namespace Bar {
  export const bar = 123;
}

export namespace Foo {
  export import TheBar = Bar;
}

I didn't know that export import was even valid at all in TS.
Right now this will emit a TSImportEqualsDeclaration with .isExported = true.
This is wrong because it means that rules have to have special handling specifically for this case in order to understand TheBar is exported.

We should breaking change fix the AST here so that the AST is instead ExportNamedDeclaration > TSImportEqualsDeclaration to align with everything else.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ASTPRs and Issues about the AST structureaccepting prsGo ahead, send a pull request that resolves this issuebreaking changeThis change will require a new major version to be releasedpackage: typescript-estreeIssues related to @typescript-eslint/typescript-estree

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions