Much better than "Standard JS" and its choice of no semicolons. I know about "Semi Standard JS", but I refuse to accept such a little difference that could be a configuration has to live in a entirely new project.
A Prettier JavaScript Formatter
21–30 of 159 posts
Re: A Prettier JavaScript Formatter
#22Re: A Prettier JavaScript Formatter
#23Re: A Prettier JavaScript Formatter
#24Nice attempt, but currently wrong. For example, it pretty-formats this code: function makeComponent() { return /*test*/ { a: 1 }; } into function makeComponent() { return /*test*/ { a: 1 }; } From my own experience writing a formatter, comments are very difficult (if one wants to preserve them). I guess the author should reparse the generated code to ensure the AST hasn't changed.
We do. The entire Flow test suite passes when pretty-printing and re-parsing and comparing ASTs. There are a very few subtle bugs like the one you mentioned above. As noted in the readme, this is a beta. It's certainly more than an attempt.
Re: A Prettier JavaScript Formatter
#25am I the only one who dislikes spaces after braces? i.e foo({ num: 3 },
Re: A Prettier JavaScript Formatter
#26Earlier quoted context omitted.
We do. The entire Flow test suite passes when pretty-printing and re-parsing and comparing ASTs. There are a very few subtle bugs like the one you mentioned above. As noted in the readme, this is a beta. It's certainly more than an attempt.
Don't let HN negativity get you down. This is an awesome project and I'll contribute bug fixes/test cases if we end up adopting it on our team (very likely based on your blog post).
Re: A Prettier JavaScript Formatter
#27Re: A Prettier JavaScript Formatter
#28Re: A Prettier JavaScript Formatter
#29Re: A Prettier JavaScript Formatter
#30Earlier quoted context omitted.
Don't let HN negativity get you down. This is an awesome project and I'll contribute bug fixes/test cases if we end up adopting it on our team (very likely based on your blog post).
the parent gave an ill example and suggest a solution, how's that a negativity?