Prettier
p/prettier
Opinionated Code Formatter.
Raz Karmi
Prettier — An opinionated code formatter
Featured
31

Prettier is an opinionated code formatter

Replies
Best
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.
Ahmad Awais ⚡

Big fan of the Prettier project, the team behind it, and how it has easier configuration. Wish there could be WordPress support (CIP → https://ahmda.ws/2EPreSL)

Pros:

Best printer of AST I've used in a long long time. Less configuration is a big plus as well. Huge community support behind it. Battle tested

Cons:

Nothing for what it promises.

Pascal Andy
VS Code user on mac here. As I mainly do devops stuff in bash I’m wondering ... will Prettier format my bash scripts ?
Taylor Crane
It just dawned on me that not everybody uses Prettier. I genuinely don't think I could ever go back to not using it. This is a must.
Brandon Bayer

It’s truly an essential for modern developers.

Pros:

Turn my ugly code into a beauty!

Cons:

It’s not automatically built into every code editor

Rami Debab

I love it ! here is a demo https://twitter.com/Sapragus/sta...

Pros:

Turns messy 3am w redbull code blocks into beauty

Cons:

None

yamalight

Changed the way I develop js apps forever

Pros:

Never think about formatting again

Cons:

Can't write code for you

Praveen Durairaju
We have been using Prettier at Hasura for the past two months for a few fairly large react codebases and it really solved our formatting issues. Combined with a pre-commit hook as well to ensure consistency across collaborators. One gripe initially was that few of our devs didn't like the opinionated formatting but there wasn't anything to automate styling either! You will get used to it eventually. Hope everybody embraces some form of code styling guide to improve productivity.
Chris

I'm not a Javascript developer so I love that Prettier makes generally good formatting decisions for me, freeing need up to think about the code. It's easy to apply Prettier to any project I'm working on, even if other proper in the project aren't using it.

Pros:

No configuration, easy to set up, defaults everyone can agree on

Cons:

Harder to tell that a project is using Prettier

Janic Duplessis
> Cons: Harder to tell that a project is using Prettier Most editors have a setting that enables format on save only if the project is using prettier (either by looking for a config file or the dependency in package.json). I find that very useful when working on multiple project that may or may not be using it.
James Long
Top Product
Maker
Hi Product Hunt! I started writing Prettier when I was working on another product (that I hope to launch on PH soon :)). I got so tired of formatting code and felt like it was slowing me down so much. Christopher (vjeux) joined early on and helped see it all the way through. I'm super excited with how far it's come and that it solved the problem so well! I honestly think it has helped my build my product faster. Let me know if you have any questions about the history of prettier or how it works. I won't be able to respond for a few days, I happen to be leaving for a vacation where I won't have any internet right now. But I'll respond (or vjeux will) when I get back!
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.
Ørta
All my JS projects use prettier, my blog uses prettier, I can't wait for the day when all my native code also uses prettier. Removes a whole area of discussion from code review.
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.
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 ;)

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!
Zhang Buzz

As a frontend engineer, the code format is very very important to me. I used ESLint at first, and have to manually format every line of code. Later I found Prettier, it really save me lots of time. However, sometimes it will conflict with specific ESLint rules, in that case, you have to manually disable some ESLint rules in .eslintrc file in order to let Prettier handle everything.

Pros:

Save time for formatting JS code.

Cons:

Conflict with ESLint.

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

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