Languages
[Edit]
EN

VS Code - create Prettier formatter configuration file

0 points
Created by:
Remy-Lebe
832

In this article, we would like to show you how to create prettier configuration file for your project in VS Code.

Quick solution:

VS Code - create prettier configuration file
VS Code - create Prettier configuration file

 

Step by step

1. go to your project in VS Code,

2. create new .prettierrc file in the project main directory,

3. set your own configuration inside the file.

Note:

The example from Quick solution presents how to set the tabWidth depending on technology (tabWidth: 4 for all file types, tabWidth: 2 only for .html files).

Practical example

In this section, we present example .prettierrc file.

{
    "tabWidth": 2,
    "overrides": [
        {
            "files": "*.html",
            "options": {
                "tabWidth": 2
            }
        }
    ]
}

Alternative titles

  1. VS Code - create prettier formatter configuration file for one project (.prettierrc)
  2. VS Code - create Prettier formatter configuration file
Donate to Dirask
Our content is created by volunteers - like Wikipedia. If you think, the things we do are good, donate us. Thanks!
Join to our subscribers to be up to date with content, news and offers.
Native Advertising
🚀
Get your tech brand or product in front of software developers.
For more information Contact us
Dirask - we help you to
solve coding problems.
Ask question.

❤️💻 🙂

Join