vscode裏面怎麼根據eslint來格式化代碼?

先確保已經安裝了 ESLint 插件

 

Plan A: 設置格式化快捷鍵

打開命令面板,搜索keyboard shortcuts

keybindings.json 中添加

{
"key": "cmd+alt+space",
"command": "eslint.executeAutofix",
"when": "editorTextFocus"
}

 

Plan B: 開啓保存時自動格式化

d用戶的 settings.json 中添加 

"eslint.autoFixOnSave": true

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章