Working with prettier in Visual studio code

“Whenever you are confronted with an opponent, conquer them with love.”

What is prettier ?

In layman terms its an handy tool that will format our code against some set standards, default formatting rules to achieve consistent code style.

How to install prettier  in VS Code?

Search > Prettier – Code formatter

Prettier - Code formatter

Note:- Incase you have different IDE try installing prettier.

How to do perform user specific settings for prettier?

VS Code > File > Preferences > Settings > Under ‘user setttings’

vscode with prettier






    // Set the default prettier settings
    "editor.formatOnSave": false,
    "prettier.singleQuote": true,
    "prettier.trailingComma": "all",
    // Enable per-language
    "[javascript]": {
        "editor.formatOnSave": true

Activate Prettier

1. CMD + Shift + P -> Format Document
1. Select the text you want to Prettify
2. CMD + Shift + P -> Format Selection

Leave a Reply

Your email address will not be published. Required fields are marked *