visual-studio-codetabssettingsindentationspace

Format using 4 spaces instead of 2 in VS Code


When I open a file in VS Code and press Alt + Shift + F, the opened file gets formatted. The 2 spaces indentation gets used in html, js, etc. even though my configurations specify 4 spaces. How could I fix it?

enter image description here

enter image description here


Solution

  • I can refer the same issue in Visual Studio. Relevent changes for each type of file extesion exist in different section with the same heading. For example C# and JavaScript/TypeScript has the same settings. So make sure you are modifying correct one.

    enter image description here