Fix: Prettier stopped working in VS Code
Question:
Why Prettier stopped working in VS Code and how to solve? Answer:
1. Check the status
2. Check default formatter
3. Check format on save option
Description:
Sometimes Prettier suddenly stops working properly in VS Code. There are several reasons for this. Let's start by going through the possible problems.
Check Prettier status
- Check Prettier status on the status bar.
- If there is no such block, then check if the Prettier extension is installed and enabled.
- If there is a warning sign then click on the Prettier text and it will open the Output panel, where you can see the error message. Maybe your Prettier config file was corrupted.
Check the default formatter
- Open settings by pressing
CTRL + ,
or using the menu itemFile -> Preferences -> Settings
- Type default formatter into the search field and check if it is set to Prettier
Alternative:
You can also check if the default formatter is set correctly by simply forcing VSCode to format your code. To do click into the code editor and from the context menu select the Format Document
option. If no default formatter is defined you will get a warning dialog:
Click on the Configure...
button and you can select Prettier from the list:
Check Format on save option
- Open settings by pressing
CTRL + ,
or using the menu itemFile -> Preferences -> Settings
- Type format on save into the search field and check if it is selected.
Reference:
VS Code formatting reference
Share "Why Prettier stopped working in VS Code and how to solve?"
Related snippets:
- Fix: Prettier stopped working in VS Code
- Split editor window in VS Code
- Change default terminal in VS Code
- Wrap selection with tag in VS Code
- Edit multiple lines at once in VS Code
- Make text uppercase in VS Code
- Associate file type in VS Code
- Change syntax highlighting in VS Code
- Search for file in VS Code
- Open files always in a new tab in VS Code
- Add vertical rulers in VS Code
- Change indentation in VS Code
- Collapse code blocks in VS Code
- Delete line without selection in VS Code
- Jump to closing bracket in VS Code
- Select all occurrences of selected word in VS Code
- Change font size in VS Code
- Toggle minimap in VS Code
- Change colors in VS Code integrated terminal
- Change file encoding in VS Code
- Disable tooltip in VS Code
- Move the sidebar panel to the right in VS Code
- Export VS Code extensions
- Toggle word wrap in VS Code
- Exclude folders from search in VS Code
- Remove trailing spaces in VS Code
- Get multiple cursors in VS Code
- Show hidden characters in VS Code
- Go back to last edited position in VS Code
- Switch between terminal and editor in VS Code
- Open VS Code with the current folder from terminal
- Navigate back to last cursor position in VS Code
- Change terminal font size in VS Code
- Format code in VS Code
- Compare two files in VS Code
- Comment out multiple lines in VSCode
- Duplicate line or selection in VS Code
- Go to line in VS Code
- Move line up or down in VS Code
Tags:
fix, solve, prettier, format, code, stop, working, formatting, vs code, visual studio code Technical term:
Prettier stopped working in VS Code