Andy J.
Andy J.

Reputation: 73

Why is VS Code Prettier extension not working?

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?

Upvotes: 2

Views: 5664

Answers (1)

M_droid
M_droid

Reputation: 2768

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

Upvotes: 3

Related Questions