Skip to content

Commit 27415ed

Browse files
committed
fix: only inherit leading comments
closes #101
1 parent ba053e6 commit 27415ed

File tree

1 file changed

+0
-6
lines changed

1 file changed

+0
-6
lines changed

src/fake-js.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -192,9 +192,7 @@ export function createFakeJsPlugin({
192192
const runtime: t.ArrayExpression = t.arrayExpression(elements)
193193

194194
if (decl !== stmt) {
195-
decl.innerComments = stmt.innerComments
196195
decl.leadingComments = stmt.leadingComments
197-
decl.trailingComments = stmt.trailingComments
198196
}
199197

200198
const symbolId = registerSymbol({
@@ -827,9 +825,5 @@ function inheritNodeComments<T extends t.Node>(oldNode: t.Node, newNode: T): T {
827825
true,
828826
)
829827

830-
newNode.trailingComments = newNode.trailingComments?.filter(
831-
(comment) => !comment.value.startsWith('# sourceMappingURL'),
832-
)
833-
834828
return newNode
835829
}

0 commit comments

Comments
 (0)