Raz Karmi

Prettier - An opinionated code formatter

by

Prettier is an opinionated code formatter

Add a comment

Replies

Best
Ahmad Awais ⚡
Big fan of the Prettier project, the team behind it, and how it has an easier configuration. 💯
Joshua Pinter
I played around with this for our React Native codebase but ended up going with ESLint (https://eslint.org/) and customizing the rules there. I like that ESLint will combine simple linting with code style in a non-automatic way.
Jan Killian

Using on all frontend projects. Saves our teams time by never having to discuss formatting again.

Pros:

Never think about formatting JavaScript/TypeScript/JSX/CSS/GraphQL/Markdown/... again.

Has good support in editors, IDE''s and command-line.

Cons:

Could extend support to more styling/markup/programming languages ;)

Connor Elsea

Everyone on the team can be on the same page about style and focus more on good quality engineering instead of styling nitpicks. Prettier works, is fast, and is extensible. It also supports other languages and file types such as TypeScript, .graphql files, CSS, and more.

Pros:

Simplifies life. No longer worry about formatting

Cons:

None

Flavio Copes
Prettier has been invaluable in helping me keep code clean and consistent. It's an awesome tool to keep your code pretty, with it's very little space for customization it's the gofmt for the JavaScript world (but it's not limited to JS). It's a great tool to use alongside ESLint for error checking and more static analysis. I wrote about my usage of Prettier on my blog https://flaviocopes.com/prettier/ recently, I really enjoy having Prettier drive more productivity as I focus on the functionality of my code rather than on the style.
Joar Wilk

Most likely the most influential project of 2017

Pros:

Achieves deterministic and robust code formatting via strong enforcement of code style opinions. A must for any JS team, small or big.

Cons:

Actually nothing.

Juraj Husar

It's awesome tool which should be used in every company doing JS/TS to speed up development, and remove need to care much about code style - which will be great by automated format.

Pros:

Remove need to manually format code again. Great to end code style wars in company.

Cons:

Not everyone might initially like all formatting rules.

Eduard Gilmutdinov

I believe it's must have for any projects (that can be formatted by this tool). The best way is configuring auto formatting by using husky + lint-staged + prettier tools.

Pros:

No worries about how code looks. Easily reviewing PRs, you see only meaningful changes.

Cons:

Not found

Adam Kelly
I'm a big believer of prettier, use it for all my javascript projects. Big fan of rust fmt and go-fmt also, similar reasons.
dan
I absolutely love this product. Not having Prettier in other languages (Ruby, Swift) has driven me insane! I'm so spoiled by this incredible tool!