Videos
Does Prettier work with TypeScript?
How do I fix Prettier and ESLint conflicts?
Why is Prettier not formatting on save?
For those trying to quickly change Prettier settings for VS Code. Here are the steps:
- Go to FILE -> PREFERENCES -> SETTINGS. (VS Code Menus)
- Settings window should open. Above (Top) there is a search. Type "Prettier"
- You should see the available Prettier settings. You can modify them :)
The new way to configure prettier settings:
- at the root of your project folder, create a new config file (I'd suggest calling it either
.prettierrc.jsonor just.prettierrc) - in that new file, add json custom settings: my go-to settings for JS are as follows:
{
"trailingComma": "none",
"tabWidth": 4,
"semi": true,
"singleQuote": true
}
I'd suggest doing this in each of your projects and including in any source control, that way every pull of the repo will automatically set some base settings for that developer's instance of prettier.
Don't know why but setting Default Formatter to ebsenp.prettier didn't work for me. But I found a similar command that worked.
- ctrl + shift + p
- Format document with
- Configure default formatter
- Choose prettier
Open settings by clicking the cog in the bottom left of the vs code side bar and selecting settings from the menu, or by hitting Ctrl+,
At the top right of the settings pane, hit the open file icon (if you hover, the tooltip will read 'Open Settings (JSON)'
Add the following line to the settings json:
"editor.defaultFormatter": "esbenp.prettier-vscode"


