I've recently installed the Prettier VS Code extension on my work computer, because I love how it makes my code look on my personal computer. For some reason, though I've uninstalled the extension, reinstalled it, and restarted VS Code, Prettier isn't working. All the answers to this problem I come across seem to attribute this to problems working with ESLint, but I don't have that installed. Here are the extensions I do have installed: - Ayu - Colorize - Debugger for Java - Java Dependency Viewer - Java Extension Pack - Java Test Runner - jshint - Language support for Java - Maven for Java - Prettier - Python - Simple React Snippets - SQL server - Visual Studio IntelliCode - Preview Any guesses what's going on?
Asked
Active
Viewed 4,815 times
2
-
1What do you mean specifically with "it does not work"? Prettier does not do anything by default. Only if you select "Format document" in the command pallet - or have FormatOnSave" activated, will it do anything – Patrick Hollweck Mar 04 '19 at 16:00
-
@PatrickHollweck I selected Format Document in the command pallet and I saw a few changes. But, it didn't change tabs to two spaces, double to single quotes, etc. I'm not sure where to activate FormatOnSave - I don't see it as an option under the Prettier settings. – Andy J. Mar 04 '19 at 16:18
-
@Andy J have you been able to resolve this issue? – orimdominic Jun 24 '19 at 04:48
1 Answers
3
For me setting default formatter
to esbenp.prettier-vscode
fixed the issue.
Go to setting by entering cmd
+ ,
and search for "default formatter". If it's null change it to esbenp.prettier-vscode
. Don't forget to change it on both "Workspace" and "User".
Also credits to: @lbragile https://stackoverflow.com/a/64273353/8779275

M_droid
- 2,447
- 2
- 25
- 35