Skip to content

Commit 9350a69

Browse files
authored
Remove node example removes line instead of adding empty statement (#11)
* 🐛 fix(remove-node): remove statement instead of replacing it for an empty statement * 🔩 chore(example): generate example after changing implementation on remove-node transformer
1 parent 732ea93 commit 9350a69

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
;
21
console.log(lodash);

example-transformers/remove-node/transformer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const transformer: ts.TransformerFactory<ts.SourceFile> = context => {
44
return sourceFile => {
55
const visitor = (node: ts.Node): ts.Node => {
66
if (ts.isImportDeclaration(node)) {
7-
return ts.createEmptyStatement();
7+
return undefined;
88
}
99

1010
return ts.visitEachChild(node, visitor, context);

0 commit comments

Comments
 (0)