vscode配置eslint保存自動(dòng)修復(fù)

在多人開發(fā)項(xiàng)目中公司都統(tǒng)一eslint代碼檢測,也是為了統(tǒng)一代碼風(fēng)格,方便后期維護(hù)。。。這是我自己的setting配置,望參考。。。

{

????"workbench.editor.enablePreview":?false,?//打開文件不覆蓋

????"search.followSymlinks":?false,?//關(guān)閉快速預(yù)覽

????"liveServer.settings.donotShowInfoMsg":?true,?//關(guān)閉liveserver提示

????"files.autoSave":?"afterDelay",?//打開自動(dòng)保存

????"editor.fontSize":?16,?//設(shè)置文字大小

????"editor.lineHeight":?24,?//設(shè)置文字行高

????"editor.lineNumbers":?"on",?//開啟行數(shù)提示

????"editor.quickSuggestions":?{?//開啟自動(dòng)顯示建議

????????"other":?true,

????????"comments":?true,

????????"strings":?true

????},

????"window.zoomLevel":?0,?//?調(diào)整窗口的縮放級(jí)別

????"editor.tabSize":?2,?//制表符符號(hào)eslint

????"editor.formatOnSave":?true,?//每次保存自動(dòng)格式化

????"eslint.autoFixOnSave":?true,?//?每次保存的時(shí)候?qū)⒋a按eslint格式進(jìn)行修復(fù)

????"prettier.eslintIntegration":?true,?//讓prettier使用eslint的代碼格式進(jìn)行校驗(yàn)

????"prettier.semi":?false,?//去掉代碼結(jié)尾的分號(hào)

????"prettier.singleQuote":?true,?//使用帶引號(hào)替代雙引號(hào)

????"javascript.format.insertSpaceBeforeFunctionParenthesis":?true,?//讓函數(shù)(名)和后面的括號(hào)之間加個(gè)空格

????"vetur.format.defaultFormatter.html":?"js-beautify-html",?//格式化.vue中html

????"vetur.format.defaultFormatter.js":?"vscode-typescript",?//讓vue中的js按編輯器自帶的ts格式進(jìn)行格式化

????"vetur.format.defaultFormatterOptions":?{

????????"js-beautify-html":?{

????????????"wrap_attributes":?"force-aligned"?//屬性強(qiáng)制折行對齊

????????}

????},

????"eslint.validate":?[?//開啟對.vue文件中錯(cuò)誤的檢查

????????"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"

}

希望對你有幫助。。。。。

?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容