-
Make sure there is a
.prettierrc
file in the project root
- Install the Vetur extension
- Make sure that these settings are in your user settings:
{
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"files.trimTrailingWhitespace": true,
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"vetur.format.defaultFormatter.html": "js-beautify-html"
}
- Install the prettier-atom extension (and all of its dependencies)
- Within Atom's settings:
- "Tab Length" should be "4"
- Within prettier-atom's settings:
- "Format Files on Save" should be checked
- "Only format if a Prettier config is found" should be checked
- Install Package Control (if you haven't already)
- Install prettier globally (
npm i -g prettier
) - Install the JsPrettier extension
- Within your JsPrettier user settings:
{
"auto_format_on_save": true,
"auto_format_on_save_requires_prettier_config": true,
}