EN
VS Code - create Prettier formatter configuration file
0
points
In this article, we would like to show you how to create prettier configuration file for your project in VS Code.
Quick solution:
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
tabWidthdepending on technology (tabWidth: 4for all file types,tabWidth: 2only for.htmlfiles).
Practical example
In this section, we present example .prettierrc file.
{
"tabWidth": 2,
"overrides": [
{
"files": "*.html",
"options": {
"tabWidth": 2
}
}
]
}