Hacker News new | ask | show | jobs
by bennyg 932 days ago
Have you tried the print width option: https://prettier.io/docs/en/options.html#print-width?
1 comments

Yes, but unlike most formatters where the width option is a maximum and it mostly leaves your code alone below that width, prettier will aggressively widen your code to fit if you up the print width setting.

I think rustfmt will actually also widen code you have put newlines in sometimes. But it's heuristic is somehow much better than prettier's.