Skip to content

Commit

Permalink
Use retainLines to fix the position of comments
Browse files Browse the repository at this point in the history
  • Loading branch information
benjie committed Sep 3, 2019
1 parent f599259 commit b3e0dc4
Show file tree
Hide file tree
Showing 9 changed files with 320 additions and 269 deletions.
6 changes: 5 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ export async function compile(code: string, filename: string) {
})

return addTrailingSpace(
trimLeadingNewlines(generate(stripAtFlowAnnotation(ast)).code)
trimLeadingNewlines(
generate(stripAtFlowAnnotation(ast), {
retainLines: true
}).code
)
)
}

Expand Down
Loading

0 comments on commit b3e0dc4

Please sign in to comment.