标签:vue 格式化 VScode eslint vscode 自动 prettier true editor
一、配置
1.点击左下角齿轮,打开设置
2.在文本编辑器里下滑找到Code Actions On Save下面的在setting.json中编辑
3.复制代码全部替换
{
"eggHelper.serverPort": 62631,
"prettier.endOfLine": "lf",
"files.autoSave": "off",
"eslint.validate": [
"javascript",
"javascriptreact",
"vue-html",
"typescript",
"vue"
],
"eslint.run": "onSave",
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"files.eol": "\n",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"emmet.excludeLanguages": ["markdown"],
"editor.formatOnType": true,
"editor.formatOnSave": true,
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
二、去除黄色波浪线
1.在项目文件夹找到.eslintrc.js文件
2.在rules里加入
"prettier/prettier": "off"
三、解决windows换行crlf与if冲突
git config --global core.autocrlf false
标签:vue,
格式化,
VScode,
eslint,
vscode,
自动,
prettier,
true,
editor
From: https://www.cnblogs.com/LuMinarY-/p/16792856.html