🌐
Brian Cline
brcline.com › home › articles › using prettier to automatically format javascript
Using Prettier to Automatically Format JavaScript - Brian Cline
April 29, 2020 - If you aren’t using Standard JavaScript or ESLint, you should be perfectly fine choosing “Prettier – Code formatter”.
🌐
Prettier
prettier.io
Prettier · Opinionated Code Formatter · Prettier
Try It OnlineInstall Prettier · Limited edition tshirts are now available to buy! $10 per tshirt goes to maintain the project. An opinionated code formatter · Supports many languages · Integrates with most editors · Has few options » · Your code is formatted on save · No need to discuss style in code review · Saves you time and energy · And more » · JavaScript ·
Discussions

Prettier: Pros and Cons

(prettier author here)

I would encourage you to set the few flags that prettier has to match what your existing codebase uses and to run it through your codebase, do git diff and see how it behaves.

If it's not outputting code that's too crazy in your opinion, then don't use it :)

More on reddit.com
🌐 r/javascript
16
8
May 2, 2016
Is using Prettier to format code bad.
It sounds to me though that you formatted some huge file that wasn't previously formatted with prettier (vs your own changes) And that is annoying af. Just incredibly noisy if it's a bug fix. Propose your refactor but do it outside of a bug fix. More on reddit.com
🌐 r/Frontend
120
99
May 23, 2023
Prettier removing camelCasing from css-in-js?

I've been wanting to use camelCase in my cssjs code too for some time.

I like react css convensions and I've used this for a while, and when I moved to jss (which is like emotion) I've used react conventions in my code as well using their library require('react/lib/CSSPropertyOperations');.

Hope it helps

More on reddit.com
🌐 r/javascript
6
7
May 12, 2016
[AskJS] eslint or prettier or both with vim + ALE? Can I get rid of prettier or is it required?
I don't think this is a vim specific issue. ESLint and Prettier are two separate tools with separate purpose. There is some overlap and you can configure ESLint to do some formatting, but Prettier cannot do linting. Often people use both and ensure that they don't overlap so ESLint purely focuses on functional things and Prettier purely focuses on formatting. More on reddit.com
🌐 r/javascript
4
2
December 2, 2021
🌐
JetBrains
jetbrains.com › help › webstorm › prettier.html
Prettier | WebStorm Documentation
Prettier is a tool to format files in various languages, like TypeScript, JavaScript, CSS, HTML, JSON, and others. With WebStorm, you can format selected code fragments as well as entire files or directories using the Reformat with Prettier action.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-use-prettier-in-visual-studio-code
How To Use Prettier in Visual Studio Code
March 18, 2024 - Prettier not only supports all JavaScript libraries and frameworks, such as Angular, React, Vue, and Svelte, but also works with TypeScript.
🌐
OpenReplay
blog.openreplay.com › using-prettier-with-vscode-to-write-javascript
Using Prettier with VSCode to write JavaScript
June 7, 2023 - Prettier is a powerful code formatting tool that can help improve the consistency, readability, and maintainability of your JavaScript codebase.
🌐
GitHub
github.com › prettier › prettier
GitHub - prettier/prettier: Prettier is an opinionated code formatter. · GitHub
JavaScript · TypeScript · Flow · JSX · JSON CSS · SCSS · Less HTML · Vue · Angular GraphQL · Markdown · YAML Your favorite language? Prettier is an opinionated code formatter.
Author   prettier
🌐
Reddit
reddit.com › r/javascript › prettier: pros and cons
r/javascript on Reddit: Prettier: Pros and Cons
May 2, 2016 -

One of my co-workers recently adopted Prettier, and at first I thought it sounded great. Automated formatting so you never have style complaints in PRs again? Sign me up.

But then I tried actually using it, and its ESLint plug-in, and was mildly horrified to discover that Prettier (through ESLint) was telling me to get rid of my trailing commas! It's not the 1990's anymore: trailing commas have been embraced throughout the JS community. Heck, even ESlint itself requires them by default.

Then I went and read the Prettier site, and it was basically full of quotes to the effect of "our team used to think about stuff, but thinking is hard, so now we use Prettier and just conform to whatever it wants, and now no one thinks anymore. Yay." And the rest of the site make site also makes it clear that Prettier is an opinionated library.

So, I was hoping to hear from people who have used Prettier and can share their experiences. Is banning trailing commas just one poor decision in an otherwise great library, or does adopting Prettier basically mean being shoehorned into whatever the Prettier people feel is best (even if they're wrong)?

To be fair, I know you can re-enable trailing commas with a flag. I'm just more worried about other "opinionated" calls the library might make that don't have flags (and which I might not discover until we've completely adopted Prettify).

Top answer
1 of 5
7

(prettier author here)

I would encourage you to set the few flags that prettier has to match what your existing codebase uses and to run it through your codebase, do git diff and see how it behaves.

If it's not outputting code that's too crazy in your opinion, then don't use it :)

2 of 5
6

As I'm sure you've noticed, the JS world has endless disagreements about style:

  • Tabs vs. spaces

  • Semicolons vs. no semicolons

  • Trailing commas vs. no trailing commas

  • Single quote vs. double quote

I am sure you can think of many others. In each of these debates, each side has has compelling arguments with different trade-offs. After all, if there was an obvious "best way", we wouldn't even be having these debates.

The prettier project has identified a handful of these issues that are deal-breakers for some people, and have made those configurable. Specifically, they let you adjust indentation, quotes, semicolons, trailing commas, and bracket spacing. These are the hot-button issues that nobody can agree on, and you are encouraged to configure them as you like. Prettier has some default settings that reflect what's popular right now, but those defaults aren't binding. Just change them and be happy.

Where prettier really shines is in breaking long statements over multiple lines. Before I adopted prettier, I would use a whole bunch of different styles without even realizing it. For example, I would do things like:

somethingReallyLong(parameterOne, parameterTwo,
  someCall (
    longParameter,
    anotherLongParameter
  ))

It's not really clear what the "right" way to format this statement would be, and there are multiple valid approaches. With prettier, however, I know that I will always get the following:

somethingReallyLong(
  parameterOne,
  parameterTwo,
  someCall(longParameter, anotherLongParameter)
)

It's self-consistent, and it looks good. More importantly, I don't waste any brain cycles thinking about line breaking anymore. I just write the statement in one long line, and when I'm done, I hit the "format document" shortcut to make everything flow. Whenever I collaborate with a coworker, I am always amazed how much time they spend formatting code. Copy-paste, re-indent, fix brackets, adjust long lines, rinse, and repeat. With prettier, all this monkey work is a thing of the past. For that, I am willing to pay the price of a few minor style quibbles (everything else I have configured to taste).

Find elsewhere
🌐
LogRocket
blog.logrocket.com › home › using prettier and eslint for javascript formatting
Using Prettier and ESLint for JavaScript formatting - LogRocket Blog
October 22, 2024 - Prettier and ESLint are code formatting and linting tools, respectively, that can be used together to improve overall code quality and streamline the development process. Linting and pretty printing JavaScript code can:
🌐
DEV Community
dev.to › g_abud › prettier-and-the-beauty-of-opinionated-code-formatters-pfg
Prettier and the Beauty of Opinionated Code Formatters - DEV Community
June 25, 2020 - For those of you that don't know, Prettier is an opinionated code formatter for Javascript/Typescript, HTML, JSX, and more. It is lightweight, requires next to no configuration, and automatically formats code for you.
🌐
GeeksforGeeks
geeksforgeeks.org › typescript › how-to-set-up-prettier-in-your-javascript-typescript-project
How to Set Up Prettier in Your JavaScript/TypeScript Project? - GeeksforGeeks
July 23, 2025 - Prettier is a driven code formatter that helps you cooperate and maintain code consistency throughout your JavaScript/TypeScript project. It makes the process of formatting code simpler, allowing developers to concentrate on the functionality ...
🌐
DigitalOcean
digitalocean.com › community › tutorials › how-to-format-code-with-prettier-in-visual-studio-code
Format Code with Prettier in Visual Studio Code: Setup Guide | DigitalOcean
August 1, 2025 - You’ll cover everything from installing the Prettier extension and configuring format-on-save, to integrating Prettier with ESLint for JavaScript and TypeScript projects.
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
Prettier - Code formatter - Visual Studio Marketplace
January 21, 2026 - Extension for Visual Studio Code - Code formatter using prettier
🌐
Beautifier
beautifier.io
Online JavaScript beautifier
Chrome, in case the built-in CSS and javascript formatting isn't enough for you: — Quick source viewer by Tomi Mickelsson (github, blog), — Javascript and CSS Code beautifier by c7sky, — jsbeautify-for-chrome by Tom Rix (github), — Pretty Beautiful JavaScript by Will McSweeney — Stackoverflow Code Beautify by Making Odd Edit Studios (github).
🌐
Visual Studio Marketplace
marketplace.visualstudio.com › items
JavaScript Prettier - Visual Studio Marketplace
Extension for Visual Studio - Prettier is an opinionated JavaScript formatter inspired by refmt with advanced support for language features from ES2017, JSX, and Flow. It removes all original styling and ensures that all outputted JavaScript ...
🌐
Jlongster
archive.jlongster.com › A-Prettier-Formatter
A Prettier JavaScript Formatter
January 10, 2017 - Today I am announcing prettier, a JavaScript formatter inspired by refmt with advanced support for language features from ES2017, JSX, and Flow. Prettier gets rid of all original styling and guarantees consistency by parsing JavaScript into an AST and pretty-printing the AST.
🌐
npm
npmjs.com › package › prettier
prettier - npm
January 21, 2026 - JavaScript · TypeScript · Flow · JSX · JSON CSS · SCSS · Less HTML · Vue · Angular GraphQL · Markdown · YAML Your favorite language? Prettier is an opinionated code formatter.
      » npm install prettier
    
Published   Jan 21, 2026
Version   3.8.1
Author   James Long
🌐
Medium
medium.com › hexacta-engineering › why-arent-you-using-prettier-4fe0a77713e8
Why aren’t you using Prettier?
June 30, 2017 - For me, this is the best part of using Prettier. Another benefit of leaving the whole code formatting to an automatic tool is that people that are not familiar with the style guidelines have one less thing to worry about. This applies to people used to different guidelines but it’s even better for people who are new to JavaScript.
🌐
JavaScript in Plain English
javascript.plainenglish.io › how-to-use-prettier-to-customize-your-code-formatting-b1a5424f2ed6
How to use prettier to customize your code formatting | by sam | JavaScript in Plain English
October 12, 2020 - How to use prettier to customize your code formatting Learn to configure and use this code formatter to make your life easier Tabs or spaces? Double or single quotes? Trailing commas and whitespace? …
🌐
Reddit
reddit.com › r/frontend › is using prettier to format code bad.
r/Frontend on Reddit: Is using Prettier to format code bad.
May 23, 2023 -

Recently joined a agency as an Contract React developer. I was assigned a task to edit some inline Scss code.

Being a Prettier user I formatted the code, made the necessary changes and submitted a pull request.

Next day the senior developer reviewed my code and asked me to stop using Prettier and assigned me a task to change back the Scss code manually to inline Scss.

When I asked why should I not use prettier to format code. He said it's bad and time consuming and other team members started telling me a story how one time prettier wasn't working and started throwing errors.

That's why they never use it.

I wanted to say that It was showing error because you were doing something wrong.

Just because you once had an bad experience doesn't mean it's bad.

Plus they use one big single Scss file for the whole project.

When I question it too and asked them to use separate files and how it can effect the performance.

One team member answered it doesn't matter, how they don't care about the performance and I should be open minded and learn from them. The boss has 18 years of experience.

What should I learn why not to follow good practices!