From ed20e6a0928dbce4cc85da8f8c107c7505e59a50 Mon Sep 17 00:00:00 2001 From: timreichen Date: Mon, 19 Apr 2021 01:55:56 +0200 Subject: [PATCH] remove type imports --- plugins/typescript/transformers/imports_exports.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/typescript/transformers/imports_exports.ts b/plugins/typescript/transformers/imports_exports.ts index 0e5cf0d..fbcbb28 100644 --- a/plugins/typescript/transformers/imports_exports.ts +++ b/plugins/typescript/transformers/imports_exports.ts @@ -23,7 +23,7 @@ export function typescriptTransformImportsExportsTransformer( return (node: ts.Node) => { if (ts.isImportDeclaration(node)) { const importClause = node.importClause; - if (importClause?.isTypeOnly) return node; + if (importClause?.isTypeOnly) return undefined; if (ts.isStringLiteral(node.moduleSpecifier)) { const resolvedSpecifier = resolve(node.moduleSpecifier.text); @@ -129,7 +129,7 @@ export function typescriptTransformImportsExportsTransformer( } return node; } else if (ts.isExportDeclaration(node)) { - if (node.isTypeOnly) return node; + if (node.isTypeOnly) return undefined; if ( node.moduleSpecifier && ts.isStringLiteral(node.moduleSpecifier) ) {