Skip to content

Commit b3e0dc4

Browse files
committed
Use retainLines to fix the position of comments
1 parent f599259 commit b3e0dc4

File tree

9 files changed

+320
-269
lines changed

9 files changed

+320
-269
lines changed

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,11 @@ export async function compile(code: string, filename: string) {
2626
})
2727

2828
return addTrailingSpace(
29-
trimLeadingNewlines(generate(stripAtFlowAnnotation(ast)).code)
29+
trimLeadingNewlines(
30+
generate(stripAtFlowAnnotation(ast), {
31+
retainLines: true
32+
}).code
33+
)
3034
)
3135
}
3236

0 commit comments

Comments
 (0)