天天看點

ESlint 格式化代碼 備忘

vscode 代碼格式化配置

vscode 菜單 檔案->首選項->設定 --->進入擴充查找到ESlint,點選任一選項中的[在setting.json中配置],複制以下代碼

{

"editor.tabSize": 2,

"files.associations": {

"*.vue": "vue"

},

"eslint.autoFixOnSave": true,

"eslint.options": {

"extensions": [

".js",

".vue"

]

},

"eslint.validate": [

"javascript",{

"language": "vue",

"autoFix": true

},"html",

"vue"

],

"search.exclude": {

"**/node_modules": true,

"**/bower_components": true,

"**/dist": true

},

"emmet.syntaxProfiles": {

"javascript": "jsx",

"vue": "html",

"vue-html": "html"

},

"git.confirmSync": false,

"window.zoomLevel": 0,

"editor.renderWhitespace": "boundary",

"editor.cursorBlinking": "smooth",

"editor.minimap.enabled": true,

"editor.minimap.renderCharacters": false,

"window.title": "${dirty}${activeEditorMedium}${separator}${rootName}",

"editor.codeLens": true,

"editor.snippetSuggestions": "top",

}