Eslint-plugin-import: TypeScript's "export import" is treated as import

Created on 19 Jun 2020  路  5Comments  路  Source: benmosher/eslint-plugin-import

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;
}
help wanted typescript

Most helpful comment

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

All 5 comments

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

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

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

@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.

Fixed in #1830.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

mieszko4 picture mieszko4  路  25Comments

Robinfr picture Robinfr  路  27Comments

ThomasdenH picture ThomasdenH  路  31Comments

msuntharesan picture msuntharesan  路  29Comments

sompylasar picture sompylasar  路  29Comments