Blog

VS Code Formatter Settings

A guide to help with VS Code Formatter settings that Prettier alone can't solve

ClaudeTranslated by Claude Opus 4.5

AI-generated content may be inaccurate or misleading.

When using VS Code, the Formatter is quite important. Usually when you search online, Prettier and Beautify are recommended.

In my case, I chose to use Prettier, but there were some languages where it didn't work. For example, Prettier didn't work for rust, go, or java.

In these cases, you can configure those languages to use separate formatters, which are usually included in the language's extension.

Below is my VS Code formatter settings.json file.

"editor.formatOnSave": true,
"[rust]": {
  "editor.defaultFormatter": "matklad.rust-analyzer"
},
"[go]": {
  "editor.defaultFormatter": "golang.go"
},
"[java]": {
  "editor.defaultFormatter": "redhat.java"
},
"editor.defaultFormatter": "esbenp.prettier-vscode",

Applying these settings should take care of at least rust, go, java, and languages that Prettier supports.

Published:
Modified:

Previous / Next