*If you get to a step and something doesn't work, restart VS Code.
- Run
git pull origin master
to ensure the .prettierrc file is in your root folder. - While in the 'vue-honey-crm' directory, run
npm install
. - In VS Code, Install the "Prettier - Code formatter" extension (esbenp.prettier-vscode).
- Open the command palette ( ctrl + shft + p ) => Search for:
Format Document With...
=> Search for:Configure Formatter...
=> SelectPrettier - Code formatter
to set it as the default formatter. - Open the command palette => Search for:
Preferences: Open Settings(JSON)
=> add the following options inside the settings object:
"editor.formatOnSave": true, //Formats on save
"prettier.requireConfig": true, //Only runs on projects with a .prettierrc in root folder
"[javascript]": { //Uses the prettier plugin for files written in this and the following
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
- Add
<!-- @format -->
to new files you create so prettier will format it on save.
Prettier: https://prettier.io/