Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
bradzacher opened this issue Nov 12, 2021 · 1 comment · Fixed by #5885
Labels
accepting prs Go ahead, send a pull request that resolves this issue AST PRs and Issues about the AST structure breaking change This change will require a new major version to be released package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Milestone

Comments

@bradzacher
Copy link
Member

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.

@bradzacher bradzacher added package: typescript-estree Issues related to @typescript-eslint/typescript-estree breaking change This change will require a new major version to be released AST PRs and Issues about the AST structure labels Nov 12, 2021
@bradzacher bradzacher added this to the 6.0.0 milestone Nov 12, 2021
@JoshuaKGoldberg JoshuaKGoldberg added the accepting prs Go ahead, send a pull request that resolves this issue label Feb 24, 2022
@JoshuaKGoldberg JoshuaKGoldberg changed the title An exported TSImportEqualsDeclaration should be wrapped in an ExportNamedDeclaration instead of having .isExported = true An exported TSImportEqualsDeclaration should be wrapped in an ExportNamedDeclaration instead of having .isExport = true Oct 25, 2022
@JoshuaKGoldberg
Copy link
Member

Resolved because #5885 was merged into v6. This'll be released with the v6 version.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepting prs Go ahead, send a pull request that resolves this issue AST PRs and Issues about the AST structure breaking change This change will require a new major version to be released package: typescript-estree Issues related to @typescript-eslint/typescript-estree
Projects
None yet
2 participants