4 ms·
If you're in the JS world check out https://github.com/prettier/prettier https://github.com/prettier/prettier if you haven't. It's used by some big projects lik
by Androider 9y ago
If you're in the JS world check out https://github.com/prettier/prettier https://github.com/prettier/prettier if you haven't. It's used by some big projects like React, Babel, webpack etc.
Unlike "traditional" formatters, it parses your code into a syntax tree completely disregarding any original formatting, meaning the output is entirely consistent. It's pretty liberating to devote zero time to manually formatting and can make code reviews more constructive and less superficial. It is what is is, and it's pretty opinionated based on Facebook's code style. Works great for us, enforced with a git hook.