vscode配置文件-vutur自動(dòng)格式化-eslint校驗(yàn)-屬性換行
{
// eslint 配置
"eslint.enable": true,
"eslint.run": "onType",
"eslint.options": {
"extensions": [
".js",
".vue",
".jsx",
".tsx"
]
},
// 自動(dòng)格式化代碼設(shè)置
"editor.codeActionsOnSave": {
"source.fixAll": true,
// "source.fixAll.eslint": true,
// 保存時(shí)格式化
"editor.formatOnSave": true,
},
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
// "wrap_line_length": 250, // 換行字符串閾值
"tabWidth": 20, // tab縮進(jìn)大小,默認(rèn)為2
"semi": false, // 去掉末尾分號(hào)
// "htmlWhitespaceSensitivity": "strict", // html空格敏感度,可選值:'css'(樣式表)|'strict'(嚴(yán)格)|'ignore'(忽略)
// "vueIndentScriptAndStyle": true, // vue文件中的script及style標(biāo)簽縮進(jìn)
// "endOfLine": "auto", // 結(jié)尾是 \n \r \n\r auto
// auto 不進(jìn)行格式化
// force 首個(gè)屬性與開始標(biāo)簽共一行,最后的屬性與開始標(biāo)簽結(jié)束的 > 符號(hào)共一行,其他屬性單獨(dú)一行。
// force-aligned 所有屬性強(qiáng)制對(duì)齊,若組件名較長(zhǎng)太不美觀,不建議使用。
// force-expand-multiline 所有屬性單獨(dú)占據(jù)一行且對(duì)齊。開始標(biāo)簽和開始標(biāo)簽結(jié)束的 > 符號(hào)同樣單獨(dú)占據(jù)一行。
"wrap_attributes": "force-aligned", //屬性換行
// "end_with_newline": false,
},
"prettyhtml": {
// "printWidth": 100,
"singleQuote": false, // //去掉末尾分號(hào)
// "wrapAttributes": false,
"sortAttributes": false
},
"prettier": {
// "semi": true, //去掉末尾分號(hào)
"trailingComma": true, // 這個(gè)就是設(shè)置是否末尾添加逗號(hào)的字段
"singleQuote": true //將所有雙引號(hào)改為單引號(hào)
}
},
// #讓vue中的js按"prettier"格式進(jìn)行格式化
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.js": "prettier",
"path-autocomplete.extensionOnImport": true,
"path-autocomplete.pathMappings": {
"@": "${folder}/src"
},
"security.workspace.trust.untrustedFiles": "open",
"editor.fontSize": 15,
"liveServer.settings.donotShowInfoMsg": true,
"less.compile": {
"out": "../css/"
},
"editor.tabSize": 2,
"[javascript]": {
"editor.defaultFormatter": "rvest.vs-code-prettier-eslint"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"workbench.startupEditor": "none",
"explorer.confirmDelete": false,
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"cssrem.rootFontSize": 80,
"cssrem.vwDesign": 1920,
"[typescript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"liveServer.settings.port": 0,
"vetur.validation.interpolation": false,
"vetur.validation.script": false,
"git.confirmSync": false,
"git.enableSmartCommit": true,
"editor.inlineSuggest.enabled": true,
"eslint.trace.server": "off",
"eslint.alwaysShowStatus": true,
"github.copilot.enable": {
"*": true,
"yaml": false,
"plaintext": false,
"markdown": false
},
"git.openRepositoryInParentFolders": "always",
"terminal.integrated.enableMultiLinePasteWarning": false,
"eslint.nodeEnv": "",
"editor.semanticTokenColorCustomizations": {},
"editor.tokenColorCustomizations": {},
"editor.bracketPairColorization.independentColorPoolPerBracketType": true,
"editor.formatOnSave": true,
"window.openFoldersInNewWindow": "on",
"window.openFilesInNewWindow": "on",
"editor.formatOnPaste": true,
"backgroundCover.imagePath": "c:\\Users\\85839\\Pictures\\壁紙\\QQ截圖20230412214624.png",
"backgroundCover.opacity": 0.3,
"backgroundCover.randomImageFolder": "c:\\Users\\85839\\Pictures\\壁紙",
"backgroundCover.autoStatus": true,
"workbench.colorTheme": "Default Dark+ Experimental",
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"javascript.updateImportsOnFileMove.enabled": "always",
"diffEditor.ignoreTrimWhitespace": false
}
效果文章來(lái)源地址http://www.zghlxwxcb.cn/news/detail-768707.html
文章來(lái)源:http://www.zghlxwxcb.cn/news/detail-768707.html
到了這里,關(guān)于vscode配置文件-vutur自動(dòng)格式化-eslint校驗(yàn)-屬性換行的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!