Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork2.8k
Description
Proposal
{"rules": {"@typescript-eslint/prefer-import-type": ["error"] }}
// your repro code caseimport{FooBar}from'foo-bar';constfoo:FooBar={foo:1,bar:2};
Expected ResultFooBar is only being used as a type, import as 'import type {FooBar}'
Actual Result
Additional Info
Since typescript now supportsimport type {X}
for type only imports that don't get emitted in js, nor do get counted as cyclic imports, it would be nice to have typescript-eslint automatically flag and fiximport {T}
toimport type {T}
If you're willing to accept the suggestion, I'm happy to create a PR and land this