logoalt Hacker News

LukaD • yesterday at 10:16 PM • 0 replies • view on HN

I haven't used prettier much but this is what the prettier docs say about empty lines.

> It turns out that empty lines are very hard to automatically generate. The approach that Prettier takes is to preserve empty lines the way they were in the original source code. There are two additional rules: > > - Prettier collapses multiple blank lines into a single blank line. > - Empty lines at the start and end of blocks (and whole files) are removed. (Files always end with a single newline, though.)

The last time I used astra it wrote a lot of rust code where it would insert almost no empty lines at all. Not before functions, structs, impl blocks, etc., and not inside functions to group statements. Similar to prettier, rustfmt doesn't really insert empty lines.

Edit: hmm maybe I misunderstood your and the parent's comment. Are you talking about missing regular newlines after statements, i.e. multiple statements on one line?