在多人開發(fā)項目中公司都統(tǒng)一eslint代碼檢測,也是為了統(tǒng)一代碼風(fēng)格沈条,方便后期維護需忿。。蜡歹。這是我自己的setting配置屋厘,望參考。月而。汗洒。
{
????"workbench.editor.enablePreview":?false,?//打開文件不覆蓋
????"search.followSymlinks":?false,?//關(guān)閉快速預(yù)覽
????"liveServer.settings.donotShowInfoMsg":?true,?//關(guān)閉liveserver提示
????"files.autoSave":?"afterDelay",?//打開自動保存
????"editor.fontSize":?16,?//設(shè)置文字大小
????"editor.lineHeight":?24,?//設(shè)置文字行高
????"editor.lineNumbers":?"on",?//開啟行數(shù)提示
????"editor.quickSuggestions":?{?//開啟自動顯示建議
????????"other":?true,
????????"comments":?true,
????????"strings":?true
????},
????"window.zoomLevel":?0,?//?調(diào)整窗口的縮放級別
????"editor.tabSize":?2,?//制表符符號eslint
????"editor.formatOnSave":?true,?//每次保存自動格式化
????"eslint.autoFixOnSave":?true,?//?每次保存的時候?qū)⒋a按eslint格式進行修復(fù)
????"prettier.eslintIntegration":?true,?//讓prettier使用eslint的代碼格式進行校驗
????"prettier.semi":?false,?//去掉代碼結(jié)尾的分號
????"prettier.singleQuote":?true,?//使用帶引號替代雙引號
????"javascript.format.insertSpaceBeforeFunctionParenthesis":?true,?//讓函數(shù)(名)和后面的括號之間加個空格
????"vetur.format.defaultFormatter.html":?"js-beautify-html",?//格式化.vue中html
????"vetur.format.defaultFormatter.js":?"vscode-typescript",?//讓vue中的js按編輯器自帶的ts格式進行格式化
????"vetur.format.defaultFormatterOptions":?{
????????"js-beautify-html":?{
????????????"wrap_attributes":?"force-aligned"?//屬性強制折行對齊
????????}
????},
????"eslint.validate":?[?//開啟對.vue文件中錯誤的檢查
????????"javascript",
????????"javascriptreact",
????????{
????????????"language":?"html",
????????????"autoFix":?true
????????},
????????{
????????????"language":?"vue",
????????????"autoFix":?true
????????}
????],
????"explorer.confirmDelete":?false,
????"editor.fontFamily":?"Consolas,?'Courier?New',?monospace,'微軟雅黑'",
????"workbench.iconTheme":?"vscode-icons",
????"workbench.colorTheme":?"Dracula"
}
希望對你有幫助。父款。溢谤。。憨攒。