Open lucacasonato opened 3 years ago
I have discovered a good way to see this phenomenon is to go to repos formatted with deno fmt
(e.g. https://github.com/denoland/deno_registry2) and run prettier on them, then run deno fmt
again. There is a difference between old deno fmt
and prettier
, and differences between prettier
and new deno fmt
, and differences between old deno fmt
and new deno fmt
.
Yeah, right now it's maintaining line breaks in many places. I wouldn't recommend turning on the "prefer single line" configuration yet as it still needs more work for some edge cases... and there are a lot of edge cases. I'm going to be slowly turning it on over time as things get better (ex. just recently turned it on for import and export declarations).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Is there any update in this area?
Here are some cases I have discovered, that I feel
deno fmt
is too lax about. What I mean with this, is thatdeno fmt
likes to maintain what currently exists, over forcing a certain style. I thinkdeno fmt
should force a certain style more often.This list is just a few examples. We should go through all dprint config options that are currently set to
Maintain
, and check if they should not be forcing a certain style instead. I think we should try to 1:1 match what prettier does.Line breaks in function arguments
For of loops