1

I am have trouble getting formatting to work for javascript in Visual Studio Code. I am using the Preitter formatter for almost everything except python. Here is my VSCode settings for some of the files.

"[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
},
"[css]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
},
"[html]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode",
    "editor.formatOnSave": true
},

And here is my .prettierrc file:

{
    "printWidth": 120,
    "tabWidth": 4,
    "useTabs": false,
    "trailingComma": "all",
    "bracketSpacing": true,
    "proseWrap": "always",
    "semi": false,
    "singleQuote": true
}

The css, html all format fine, specifically the tab with. However my javascript files don't indent 4 spaces only 2. VSCode's default tab with is also set to 4. Any help would be greatly appreciated.

Thanks Dawson

DawsonMSchaffer
  • 119
  • 1
  • 2
  • 8
  • How is this related to programming? – B001ᛦ Jun 03 '21 at 19:44
  • 1
    @B001ᛦ There's even a tag for vscode-related questions... – MoPaMo Jun 03 '21 at 19:55
  • 1
    @B001ᛦ VS Code most certainly falls into the "software tools commonly used by programmers" category specified by the [help/on-topic] as on-topic. – zcoop98 Jun 03 '21 at 19:55
  • 3
    Does this answer your question? [How do I Change VSCode To Indent 4 Spaces Instead Of Default 2?](https://stackoverflow.com/questions/49167053/how-do-i-change-vscode-to-indent-4-spaces-instead-of-default-2) – zcoop98 Jun 03 '21 at 19:57

0 Answers0