Skip to content

Commit

Permalink
Remove import statement if all of specifiers are type-only one
Browse files Browse the repository at this point in the history
  • Loading branch information
sosukesuzuki committed Oct 16, 2021
1 parent ec6398e commit 6b79fd1
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 3 deletions.
2 changes: 1 addition & 1 deletion packages/babel-plugin-transform-typescript/src/index.ts
Expand Up @@ -288,7 +288,7 @@ export default declare((api, opts) => {
}
}

if (!onlyRemoveTypeImports && isAllSpecifiersElided()) {
if (isAllSpecifiersElided()) {
stmt.remove();
} else {
for (const importPath of importsToRemove) {
Expand Down
Expand Up @@ -5,6 +5,5 @@ import d, { d2 } from "d";
import e, { e3 as e4 } from "e";
import "f";
import "g";
import "k";
import { L2 } from "l";
;
@@ -1 +0,0 @@
import "x";

0 comments on commit 6b79fd1

Please sign in to comment.