mirror of
https://github.com/swc-project/swc.git
synced 2024-11-23 09:38:16 +03:00
fix(es/lints): Ignore type-only imports while checking duplicates (#4163)
This commit is contained in:
parent
32c2de1181
commit
fce554cfb0
@ -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);
|
||||
|
||||
|
6
crates/swc_ecma_lints/tests/pass/issue-4148/1/input.ts
Normal file
6
crates/swc_ecma_lints/tests/pass/issue-4148/1/input.ts
Normal file
@ -0,0 +1,6 @@
|
||||
//a.ts
|
||||
import type { Foo } from "./b";
|
||||
const Foo = "hey";
|
||||
|
||||
// b.ts
|
||||
export type Foo = string;
|
Loading…
Reference in New Issue
Block a user