Skip to content

Commit

Permalink
chore: add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
underfin committed Dec 27, 2024
1 parent bdd11fa commit 92508b4
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions crates/oxc_transformer/src/typescript/annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,11 +120,13 @@ impl<'a, 'ctx> Traverse<'a> for TypeScriptAnnotations<'a, 'ctx> {
&s.local
}
};
// Should preserve `import x from 'x'`(x is unused) if only_remove_type_imports enable
if self.only_remove_type_imports {
return true;
}
self.has_value_reference(&id.name, ctx)
});
// Should transform `import { type x } from 'x'`` to `import 'xx'` if only_remove_type_imports enable
if all_specifiers_is_type && self.only_remove_type_imports {
*decl = ctx.ast.alloc_import_declaration(
decl.span,
Expand Down

0 comments on commit 92508b4

Please sign in to comment.