Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I'll try to give these style updates in my PRs from now on.
Improvement: Binary Expression Operator Precedence
For example, given the following:
It now formats like so:
Previously,
&&
and||
had the same precedence along with basically everything else.Prettier formats like so and I've opened https://github.com/dprint/dprint/issues/200 for adding parens like this:
Note, I deviated from prettier and gave division and multiplication the same precedence. It made sense to me that they should be equal precedence because they're essentially the same thing.
Other Improvements
Performance
Overall, the performance has degraded by about 25% lately. I am planning on working on some dprint specific debugging tools to make it very fast, but right now I'm more focused on making sure it works well.
Future
preferSingleLine
config, which is currentlyfalse
. The config is all wired up, but I've noticed how it formats when that'strue
still needs lots of work for certain edge cases.