fix(es/lints): Ignore type-only imports while checking duplicates (#4163)

This commit is contained in:
magic-akari 2022-03-26 14:25:17 +08:00 committed by GitHub
parent 32c2de1181
commit fce554cfb0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 0 deletions

View File

@ -132,6 +132,14 @@ impl Visit for DuplicateBindings {
d.visit_children_with(self);
}
fn visit_import_decl(&mut self, s: &ImportDecl) {
if s.type_only {
return;
}
s.visit_children_with(self);
}
fn visit_import_default_specifier(&mut self, s: &ImportDefaultSpecifier) {
s.visit_children_with(self);

View File

@ -0,0 +1,6 @@
//a.ts
import type { Foo } from "./b";
const Foo = "hey";
// b.ts
export type Foo = string;