4 ms·
You might be surprised at the quality of the output (obviously I'm biased). We've tried to choose what most people consider to be the best way to style code, an
by jlongster 10y ago
You might be surprised at the quality of the output (obviously I'm biased). We've tried to choose what most people consider to be the best way to style code, and many times prettier ends up formatting complex code better than I would have manually. Also, the biggest benefit that a lot of people don't realize is it allows you to quickly restructure your code easily: http://jlongster.com/s/refactor.gif http://jlongster.com/s/refactor.gif
I understand if the way prettier formats your code is not the way you would like, and is more of a hindrance than helpful. But I hope the above gif shows why it is freeing for a lot of people.
Also, note that prettier does keep the original blank lines in your code. That's where most of the rhythm comes from, and we allows authors to group code however they want. The rest of it is basically choosing whether to insert a space here or there or not.
I respect your work, antirez, and I hope you at least try it once! It's totally fine if it's not useful for you though.
- antirez 10y agoHello! Don't get me wrong, I'm not saying that code formatters are not useful, they are massively useful in order to turn badly formatted code into more readable code, and also when there is to integrate some code from a code base to another and needs to be re-formatted and so forth. What I find odd is that there are people using it as a "to go" solution for code indentation. The fact btw that it keeps the original blank lines is a great feature that saves a lot of semantics. Thanks for your comment!