Languages
[Edit]
EN

VS Code - set 4 spaces indentation (Prettier)

0 points
Created by:
Aleena
694

In this article, we would like to show you how to set 4 spaces indentation in VS Code working with Prettier formatter.

Quick solution:

File -> Preferences -> Settings -> search for: "Prettier: Tab Width" -> change value to 4

 

Practical example

1. Open settings using: File -> Preferences -> Settings.

VS Code - Open Settings
VS Code - Open Settings

2. Set Prettier: Tab Width to 4.

Prettier - set 4 spaces indentation
Prettier - set 4 spaces indentation

Alternative titles

  1. VS Code - format on save with 4 spaces indentation (Prettier)
  2. Prettier - set 4 spaces indentation
  3. VS Code - set 4 spaces indent (Prettier)
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