赶紧拿小本本记下这个没报错、警告的配置,👴搞了好久
eslint一生之敌!
{
"workbench.startupEditor": "newUntitledFile",
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript",
"*.vue": "vue",
"*.js": "javascript",
"*.conf": "bat"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"[markdown]": {
"editor.formatOnSave": true,
"editor.formatOnPaste": true,
"editor.defaultFormatter": "DavidAnson.vscode-markdownlint"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"workbench.preferredHighContrastColorTheme": "Default Dark+",
"explorer.confirmDelete": false,
"[html]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
},
"[json]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
"eslint.codeAction.showDocumentation": {
"enable": true
},
"[jsonc]": {
"editor.defaultFormatter": "vscode.json-language-features"
},
// 忽略警告
"vetur.ignoreProjectWarning": true,
"eslint.nodeEnv": "",
"typescript.tsdk": "",
"[css]": {
"editor.defaultFormatter": "HookyQR.beautify"
},
"html.format.indentHandlebars": true,
"beautify.config": "",
"[wxml]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
// tab 大小为2个空格
"editor.tabSize": 2,
// 100 列后换行
"editor.wordWrapColumn": 100,
// 保存时格式化
"editor.formatOnSave": true,
// 开启 vscode 文件路径导航
"breadcrumbs.enabled": true,
// 显示 markdown 中英文切换时产生的特殊字符
"editor.renderControlCharacters": true,
// eslint 检测文件类型
"eslint.validate": [
"javascript",
"javascriptreact",
"vue",
"html"
],
// vetur 的自定义设置
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true, // 单引号
"semi": false, // 末尾不添加分号
"trailingComma": "none", // 禁止随时添加逗号,这个很重要。找了好久
}
},
// 每次保存时将代码按eslint格式进行保存
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true,
"source.fixAll.markdownlint": true
},
// 修改500ms后自动保存
"files.autoSaveDelay": 500,
"security.workspace.trust.untrustedFiles": "open",
// #让函数(名)和后面的括号之间加个空格
"javascript.format.insertSpaceBeforeFunctionParenthesis": false,
// 匿名函数关键字function 与 小括号 之间不能有空格(true就有false就没)。
"javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": true,
"editor.formatOnType": true,
// 文件末尾自动加空行
"files.insertFinalNewline": true,
// mpx配置
"mpx.format.defaultFormatter.html": "prettier",
"mpx.format.defaultFormatter.css": "prettier",
"mpx.format.defaultFormatter.scss": "prettier",
"mpx.format.defaultFormatter.less": "prettier",
"mpx.format.defaultFormatter.stylus": "stylus-supremacy",
"mpx.format.defaultFormatter.js": "vscode-typescript",
"mpx.format.defaultFormatter.ts": "vscode-typescript",
"mpx.format.defaultFormatter.json": "prettier",
"mpx.format.defaultFormatterOptions": {
"prettyhtml": {
"printWidth": 100, // 1行不超过100个字符
"singleQuote": false, // 不使用单引号
"wrapAttributes": false, // 属性不换行
"sortAttributes": false // 属性不排序
},
"prettier": {
"printWidth": 100, // 1行不超过100个字符
"singleQuote": true, // 使用单引号
"wrapAttributes": false, // 属性不换行
"sortAttributes": false, // 属性不排序
"semi": false, // 不使用分号结尾
"insertSpaceBeforeFunctionParenthesis": false, // 函数括号前插入空格
"insertSpaceAfterFunctionKeywordForAnonymousFunctions": true, // 匿名函数关键字function 与 小括号 之间不能有空格(true就有false就没)。
"editor.tabSize": 2, // tab 大小为2个空格
"trailingComma": "none" // 在对象或数组最后一个元素后面是否加逗号(在ES5中加尾逗号)
},
"stylus-supremacy": {
"insertColons": true, // 使不使用括号
"insertSemicolons": true, // 使不使用冒号
"insertBraces": true, // 使不使用分号
"insertNewLineAroundImports": true, // import之后插入空行
"insertNewLineAroundBlocks": true // 每个块添不添加空行
}
},
// prettier配置
"prettier.trailingComma": "none", // 在对象或数组最后一个元素后面是否加逗号(在ES5中加尾逗号)
"prettier.semi": false, // 句尾添加分号
"workbench.iconTheme": "vscode-icons",
"bracket-pair-colorizer-2.depreciation-notice": false,
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.editor.splitInGroupLayout": "vertical",
"vsicons.dontShowNewVersionMessage": true,
"minapp-vscode.disableAutoConfig": true,
"tabnine.experimentalAutoImports": true,
"editor.minimap.enabled": false,
"editor.inlineSuggest.enabled": true,
"liveServer.settings.donotShowInfoMsg": true,
"timeline.excludeSources": [],
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[mpx]": {
"editor.defaultFormatter": "pagnkelly.mpx"
},
"git.path": "D:/Program Files/Git/bin/git.exe"
}