Prettier logo

Prettier

Prettier is an opinionated code formatter.
322
133
+ 1
0

What is Prettier?

Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.
Prettier is a tool in the Code Review category of a tech stack.
Prettier is an open source tool with 34.7K GitHub stars and 2.1K GitHub forks. Here鈥檚 a link to Prettier's open source repository on GitHub

Who uses Prettier?

Companies
113 companies reportedly use Prettier in their tech stacks, including Swat.io, AgFlow, and Liferay.

Developers
178 developers on StackShare have stated that they use Prettier.

Prettier Integrations

Why developers like Prettier?

Here鈥檚 a list of reasons why companies and developers use Prettier
Top Reasons
Be the first to leave a pro
Prettier Reviews

Here are some stack decisions, common use cases and reviews by companies and developers who chose Prettier in their tech stack.

Johnny Bell
Johnny Bell
Senior Software Engineer at StackShare | 17 upvotes 143.2K views
Webpack
Webpack
Node.js
Node.js
Yarn
Yarn
npm
npm
Babel
Babel
Prettier
Prettier
ESLint
ESLint
#ES6
#ES5

So when starting a new project you generally have your go to tools to get your site up and running locally, and some scripts to build out a production version of your site. Create React App is great for that, however for my projects I feel as though there is to much bloat in Create React App and if I use it, then I'm tied to React, which I love but if I want to switch it up to Vue or something I want that flexibility.

So to start everything up and running I clone my personal Webpack boilerplate - This is still in Webpack 3, and does need some updating but gets the job done for now. So given the name of the repo you may have guessed that yes I am using Webpack as my bundler I use Webpack because it is so powerful, and even though it has a steep learning curve once you get it, its amazing.

The next thing I do is make sure my machine has Node.js configured and the right version installed then run Yarn. I decided to use Yarn because when I was building out this project npm had some shortcomings such as no .lock file. I could probably move from Yarn to npm but I don't really see any point really.

I use Babel to transpile all of my #ES6 to #ES5 so the browser can read it, I love Babel and to be honest haven't looked up any other transpilers because Babel is amazing.

Finally when developing I have Prettier setup to make sure all my code is clean and uniform across all my JS files, and ESLint to make sure I catch any errors or code that could be optimized.

I'm really happy with this stack for my local env setup, and I'll probably stick with it for a while.

See more
Johnny Bell
Johnny Bell
Senior Software Engineer at StackShare | 17 upvotes 90.2K views
Git
Git
Prettier
Prettier
Visual Studio Code
Visual Studio Code
PhpStorm
PhpStorm
Sublime Text
Sublime Text
Magento
Magento
#Frontend
#PHP

I've been in the #frontend game for about 7 years now. I started coding in Sublime Text because all of the tutorials I was doing back then everyone was using it. I found the speed amazing compared to some other tools at the time. I kept using Sublime Text for about 4-5 years.

I find Sublime Text lacks some functionality, after all it is just a text editor rather than a full fledged IDE. I finally converted over to PhpStorm as I was working with Magento and Magento as you know is mainly #PHP based.

This was amazing all the features in PhpStorm I loved, the debugging features, and the control click feature when you click on a dependency or linked file it will take you to that file. It was great.

PhpStorm is kind of slow, I found that Prettier was taking a long time to format my code, and it just was lagging a lot so I was looking for alternatives. After watching some more tutorial videos I noticed that everyone was using Visual Studio Code. So I gave it a go, and its amazing.

It has support for everything I need with the plugins and the integration with Git is amazing. The speed of this IDE is blazing fast, and I wouldn't go back to using PhpStorm anymore. I highly recommend giving Visual Studio Code a try!

See more
Johnny Bell
Johnny Bell
Senior Software Engineer at StackShare | 11 upvotes 38.3K views
atStackShareStackShare
Visual Studio Code
Visual Studio Code
PhpStorm
PhpStorm
WebStorm
WebStorm
Prettier
Prettier
Ruby
Ruby
RubyMine
RubyMine
#Help

When I switched to Visual Studio Code 12 months ago from PhpStorm I was in love, it was great. However after using VS Code for a year, I see myself switching back and forth between WebStorm and VS Code. The VS Code plugins are great however I notice Prettier, auto importing of components and linking to the definitions often break, and I have to restart VS Code multiple times a week and sometimes a day.

We use Ruby here so I do like that Visual Studio Code highlights that for me out of the box, with WebStorm I'd need to probably also install RubyMine and have 2 IDE's going at the same time.

Should I stick with Visual Studio Code, or switch to something else? #help

See more
Johnny Bell
Johnny Bell
Senior Software Engineer at StackShare | 9 upvotes 6.2K views
Prettier
Prettier
Visual Studio Code
Visual Studio Code

Prettier not formatting code on save in Visual Studio Code? - I've come across the same issue and took me a long time googling around to find the issue.

It is actually a very simple fix. Add the below to your Visual Studio Code settings.json

"[javascript]": {
    "editor.formatOnSave": true
},
"[javascriptreact]": {
  "editor.formatOnSave": true
}
See more
Russel Werner
Russel Werner
Lead Engineer at StackShare | 7 upvotes 55.6K views
atStackShareStackShare
Prettier
Prettier
ESLint
ESLint
WebStorm
WebStorm
Visual Studio Code
Visual Studio Code

We use Prettier because when we rebooted our front-end stack, I decided that it would be an efficient use of our time to not worry about code formatting issues and personal preferences during peer review. Prettier eliminates this concern by auto-formatting our code to a deterministic output. We use it along with ESLint and have 1st-class support in our WebStorm and Visual Studio Code editors.

See more
Buzz Zhang
Buzz Zhang
CTO at Qiban | 7 upvotes 11.5K views
at浼佸姙浼佸姙
Visual Studio Code
Visual Studio Code
ESLint
ESLint
Prettier
Prettier

I use Visual Studio Code because plugins. For choosing IDE, the most important part is not IDE itself, but plugins. Some may argues that Visual Studio Code is not IDE, but I like to call it IDE, any text editor can do debug is IDE. Visual Studio Code can do it, and can use ESLint and Prettier , so it's IDE.

See more

Prettier Alternatives & Comparisons

What are some alternatives to Prettier?
EditorConfig
It is a file format and collection of text editor plugins. It helps maintain consistent coding styles for multiple developers working on the same project across various editors and IDEs.
ESLint
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
SonarQube
SonarQube provides an overview of the overall health of your source code and even more importantly, it highlights issues found on new code. With a Quality Gate set on your project, you will simply fix the Leak and start mechanically improving.
Code Climate
After each Git push, Code Climate analyzes your code for complexity, duplication, and common smells to determine changes in quality and surface technical debt hotspots.
Codacy
Codacy is an automated code review tool for Scala, Java, Ruby, JavaScript, PHP, Python, CoffeeScript and CSS. It's continuous static analysis without the hassle. Save time in Code Reviews. Tackle your technical debt
See all alternatives

Prettier's Followers
133 developers follow Prettier to keep up with related blogs and decisions.
yusuken1983
Chris Reynoso
praveen kumar
Leho Larven
Simon Rascovsky
gggfox
Atom Bank
Hriday Agarwal
Edgar Dias
Zaid Daghestani