Setting auto-formatting of vite vue.js 3 project with VSCode
Table of contents
No headings in the article.
紀錄一下
ref source: https://vueschool.io/articles/vuejs-tutorials/eslint-and-prettier-with-vite-and-vue-js-3/
npm init vite@latest
or
npm create vuetify
npm install --save-dev --save-exact prettier
npm install --save-dev eslint eslint-plugin-vue
npm install eslint-config-prettier --save-dev
in .vscode/settings.json
{
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}