vscode 自动格式化 好使的配置 setting.json 20210622
一直用idea,今天有个需求得用vscode,发现格式化不好使了
用 vetur 格式化
结果带分行什么的,eslint 过去不了,更新了个好使的配置,记录一下。
{
"update.mode": "manual",
"extensions.autoUpdate": false,
"extensions.autoCheckUpdates": false,
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.fontSize": 22,
"editor.fontFamily": "Consolas, 'Courier New', monospace",
"editor.fontLigatures": false,
"editor.fontWeight": "400",
"editor.lineHeight": 28,
"editor.letterSpacing": 0,
"editor.tabSize": 2,
"editor.insertSpaces": true,
"editor.detectIndentation": true,
"editor.wordWrap": "off",
"editor.renderLineHighlight": "gutter",
"editor.roundedSelection": true,
"editor.renderControlCharacters": true,
"editor.renderIndentGuides": true,
"editor.dragAndDrop": false,
"editor.minimap.enabled": false,
"editor.minimap.showSlider": "mouseover",
"editor.minimap.renderCharacters": true,
"editor.minimap.maxColumn": 200,
"editor.quickSuggestions": {
"strings": true
},
"editor.suggestSelection": "first",
"window.titleBarStyle": "native",
"window.menuBarVisibility": "visible",
"window.title": "${rootName} - ${dirty}${activeEditorLong}",
"workbench.colorTheme": "Spacegray Eighties Dark",
"workbench.iconTheme": "material-icon-theme",
"workbench.startupEditor": "welcomePage",
"workbench.activityBar.visible": true,
"workbench.sideBar.location": "left",
"workbench.editor.enablePreview": true,
"workbench.editor.tabSizing": "fit",
"workbench.editor.wrapTabs": false,
"workbench.editor.decorations.colors": true,
"workbench.editor.decorations.badges": true,
"workbench.tree.renderIndentGuides": "none",
"workbench.colorCustomizations": {
// "statusBar.background": "#333333",
// "statusBar.foreground": "#adadad",
"terminal.background": "#000000",
"terminal.foreground": "#FFFFFF"
},
"breadcrumbs.enabled": true,
"breadcrumbs.symbolPath": "off",
"explorer.openEditors.visible": 0,
"explorer.compactFolders": false,
"files.encoding": "utf8",
"files.eol": "\r\n",
"files.hotExit": "onExit",
"files.autoSave": "off",
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
//javascript
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"js/ts.implicitProjectConfig.experimentalDecorators": true,
//git
"git.path": "D:\\Git\\bin\\git.exe",
"git.enableSmartCommit": false,
//terminal
//"terminal.integrated.shell.windows": "C:\\Windows\\sysnative\\cmd.exe",
//"terminal.integrated.shell.windows": "D:\\Git\\git-bash.exe",
"terminal.explorerKind": "integrated",
//eslint
"eslint.format.enable": false,
"eslint.validate": [
"javascript",
"javascriptreact",
"vue",
"typescript",
"typescriptreact"
],
//bookmarks
"bookmarks.saveBookmarksInProject": true,
//vetur
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned"
}
},
"vetur.validation.template": false,
//liveServer
"liveServer.settings.donotVerifyTags": true,
//alias-skip
"alias-skip.mappings": {
"@": "/src",
"_c": "/src/components"
},
"[vue]": {
"editor.defaultFormatter": "hikerpig.vetur"
},
"[markdown]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": false,
"editor.formatOnSave": false
},
"[jsonc]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
// {
// // #让prettier使用eslint的代码格式进行校验
// "javascript.format.enable": false,
// "javascript.format.insertSpaceAfterCommaDelimiter": false,
// "javascript.format.insertSpaceAfterFunctionKeywordForAnonymousFunctions": false,
// "javascript.format.insertSpaceAfterConstructor": false,
// "javascript.format.insertSpaceAfterKeywordsInControlFlowStatements": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingJsxExpressionBraces": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBraces": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyBrackets": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingNonemptyParenthesis": false,
// "javascript.format.insertSpaceAfterOpeningAndBeforeClosingTemplateStringBraces": false,
// "javascript.format.insertSpaceAfterSemicolonInForStatements": false,
// "javascript.format.insertSpaceBeforeAndAfterBinaryOperators": false,
// "javascript.format.insertSpaceBeforeFunctionParenthesis": false,
// "javascript.format.placeOpenBraceOnNewLineForControlBlocks": false,
// "javascript.format.placeOpenBraceOnNewLineForFunctions": false,
// "prettier.eslintIntegration": true,
// "editor.fontSize": 20,
// "workbench.iconTheme": "material-icon-theme",
// "workbench.colorTheme": "Spacegray Eighties Dark",
// // "terminal.integrated.shell.windows": "C:\\Windows\\System32\\cmd.exe",
// // "git.enableSmartCommit": true,
// // "git.autofetch": true,
// // "git.confirmSync": false,
// // "[javascript]": {
// // "editor.defaultFormatter": "HookyQR.beautify"
// // },
// // "php.validate.executablePath": "C:\\wamp\\bin\\php\\php5.6.25\\php.exe",
// // "phpserver.browser": "google-chrome",
// // "editor.fontLigatures": null,
// "editor.formatOnSave": true,
// "editor.codeActionsOnSave": {
// "source.fixAll.eslint": true
// },
// "editor.tabSize": 2,
// "editor.insertSpaces": true,
// //javascript
// "javascript.format.insertSpaceBeforeFunctionParenthesis": true,
// // "javascript.implicitProjectConfig.experimentalDecorators": true,
// //eslint
// "eslint.format.enable": false,
// "eslint.validate": ["javascript", "javascriptreact", "vue"],
// //vetur
// "vetur.format.defaultFormatter.js": "vscode-typescript",
// "vetur.format.defaultFormatter.html": "js-beautify-html",
// "vetur.format.defaultFormatterOptions": {
// "js-beautify-html": {
// "wrap_attributes": "force-aligned"
// }
// },
// "vetur.validation.template": false,
// //vetur
// // "vetur.format.defaultFormatter.js": "vscode-typescript",
// // // "vetur.format.defaultFormatter.html": "js-beautify-html",
// // "vetur.format.defaultFormatterOptions": {
// // "js-beautify-html": {
// // "wrap_attributes": "force-aligned"
// // }
// // },
// // "vetur.validation.template": false,
// "terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
// "git.confirmSync": false,
// "git.enableSmartCommit": true,
// "editor.suggestSelection": "first",
// "vsintellicode.modify.editor.suggestSelection": "automaticallyOverrodeDefaultValue",
// "workbench.editorAssociations": {
// "*.ipynb": "jupyter.notebook.ipynb"
// },
// "[html]": {
// "editor.defaultFormatter": "HookyQR.beautify"
// },
// "[javascript]": {
// "editor.defaultFormatter": "vscode.typescript-language-features"
// },
// "[jsonc]": {
// "editor.defaultFormatter": "esbenp.prettier-vscode"
// },
// "[vue]": {
// "editor.defaultFormatter": "esbenp.prettier-vscode"
// }
// }
---------------------------------------------
生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!
https://pengchenggang.gitee.io/navigator/
SMART原则:
目标必须是具体的(Specific)
目标必须是可以衡量的(Measurable)
目标必须是可以达到的(Attainable)
目标必须和其他目标具有相关性(Relevant)
目标必须具有明确的截止期限(Time-based)
生活的意义就是你自己知道你要做什么,明确目标。没有目标,后面都是瞎扯!
https://pengchenggang.gitee.io/navigator/
SMART原则:
目标必须是具体的(Specific)
目标必须是可以衡量的(Measurable)
目标必须是可以达到的(Attainable)
目标必须和其他目标具有相关性(Relevant)
目标必须具有明确的截止期限(Time-based)