Skip to content

Commit

Permalink
Don't use return
Browse files Browse the repository at this point in the history
  • Loading branch information
Dunqing committed Jan 6, 2025
1 parent da88ca3 commit 447ca8e
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions crates/oxc_transformer/src/typescript/annotations.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit 447ca8e

Please sign in to comment.