vscode配置文件-vutur自动格式化-eslint校验-属性换行
{
// eslint 配置
"eslint.enable": true,
"eslint.run": "onType",
"eslint.options": {
"extensions": [
".js",
".vue",
".jsx",
".tsx"
]
},
// 自动格式化代码设置
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
// 保存时格式化
// "editor.formatOnSave": true,
// prettier 设置语句末尾加分号 true 加分号 false 不加分号
// "prettier.semi": false,
// 使用单引号代替双引号
// "prettier.singleQuote": true,
// 设置 eslint 保存时自动修复 和 editor.formatOnSave 选一即可 影响 function () {} 格式
// "eslint.autoFixOnSave": true,
},
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_line_length": 80, // 换行字符串阈值
"wrap_attributes": "force-aligned", //"force-aligned" //属性强制折行对齐
"end_with_newline": true, // html 属性是否换行
},
"prettyhtml": {
"printWidth": 100,
"singleQuote": false, // //去掉末尾分号
"wrapAttributes": false,
"sortAttributes": false
},
"prettier": {
"semi": true, //去掉末尾分号
"trailingComma": true, // 这个就是设置是否末尾添加逗号的字段
"singleQuote": true //将所有双引号改为单引号
}
},
// #让vue中的js按"prettier"格式进行格式化
"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\\Administrator\\Desktop\\资源\\vscod壁纸\\QQ截图20230412214533.png",
"backgroundCover.opacity": 0.3,
"backgroundCover.randomImageFolder": "c:\\Users\\Administrator\\Desktop\\资源\\vscod壁纸",
"backgroundCover.autoStatus": true,
"workbench.colorTheme": "Default Dark+ Experimental",
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
}
}
效果