From 447ca8e6d2cf18dff56acdb3a6f6476f12f7baa9 Mon Sep 17 00:00:00 2001 From: Dunqing Date: Mon, 6 Jan 2025 12:27:21 +0800 Subject: [PATCH] Don't use return --- .../src/typescript/annotations.rs | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/crates/oxc_transformer/src/typescript/annotations.rs b/crates/oxc_transformer/src/typescript/annotations.rs index f5c303741f22a..77e01b975e773 100644 --- a/crates/oxc_transformer/src/typescript/annotations.rs +++ b/crates/oxc_transformer/src/typescript/annotations.rs @@ -125,18 +125,18 @@ impl<'a, 'ctx> Traverse<'a> for TypeScriptAnnotations<'a, 'ctx> { } }); - if !specifiers.is_empty() { - return true; - } - - // `import { type A } from 'mod'` - if self.only_remove_type_imports { - // -> `import 'mod'` - decl.specifiers = None; - true + if specifiers.is_empty() { + // `import { type A } from 'mod'` + if self.only_remove_type_imports { + // -> `import 'mod'` + decl.specifiers = None; + true + } else { + // Remove the import declaration if all specifiers are removed + false + } } else { - // Remove the import declaration if all specifiers are removed - false + true } } } else {