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

TypeScript's "export import" is treated as import #1829

Closed
be5invis opened this issue Jun 19, 2020 · 5 comments
Closed

TypeScript's "export import" is treated as import #1829

be5invis opened this issue Jun 19, 2020 · 5 comments

Comments

@be5invis
Copy link
Contributor

be5invis commented Jun 19, 2020

TypeScript has a special syntax to re-export an namespace looks like export import <name> = <binding>. Currently eslint-plugin-import is treating them as imports and applies incorrect rules.

// with import/order, the "export import" line will cause an error
import { Point } from "./point";
export namespace SomeNamespace {
    export import Pt = Point;
}
@ljharb
Copy link
Member

ljharb commented Jun 19, 2020

If you could provide a PR with a failing test case, that'd be most helpful.

@ljharb
Copy link
Member

ljharb commented Jun 19, 2020

Although, this might have been fixed in #1823 - can you check with latest master?

@be5invis
Copy link
Contributor Author

@ljharb It looks like that #1823 fixed this issue. I created a PR to add a test about this.

@be5invis
Copy link
Contributor Author

be5invis commented Jun 19, 2020

@ljharb Tests in #1830 shows newline-after-import doesn't recognize TypeScript's export import and treated it as an import instead of an export.

@ljharb
Copy link
Member

ljharb commented Jun 19, 2020

Fixed in #1830.

@ljharb ljharb closed this as completed Jun 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants