Re:A Prettier JavaScript Formatter
by overcast on Tuesday January 10, 2017 @02:21PM
(#13368010)
It's almost crazy to think this already isn't just a thing. Why is this just coming to a head now, after all these years of carrying on over code formatting?
[ Parent
| on HN ]
Re:A Prettier JavaScript Formatter
by kajecounterhack on Tuesday January 10, 2017 @02:35PM
(#13368156)
Many communities have been using their own solutions for it for a while (e.g pylint / pep8 if you've used Python, clang-format for C++, js-beautify for javascript, etc) and many companies use "linter as style enforcer" but you still need to watch out for some things that linters don't catch in most languages.
FWIW if you use vim, this plugin is great: https://github.com/google/vim-codefmt
Re:A Prettier JavaScript Formatter
by mrgoldenbrown on Tuesday January 10, 2017 @04:01PM
(#13368938)
I'm not convinced it is just coming to a head now. I've seen automatic/forced formatting on projects at least as far back as 2000, when I entered the workforce.
The ones I've used for java have been consistently bad though. Autoformat as a commit hook leads to ugly code. Granted, I mean "bad" as in "gets ya 75% of the way".
Yes, forced/automated based on that company standards. I'm referring more to universal.
I bet you heard of "go fmt".