前端setting.json配置
方案1:
{
# "prettier.configPath": "~/.prettierrc",
"editor.fontSize": 15,
"editor.tabSize": 2,
"path-autocomplete.extensionOnImport": true,
"path-autocomplete.pathMappings": {
"@": "${folder}/src"
},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": true
},
"eslint.alwaysShowStatus": true,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.ignoreProjectWarning": true,
"vetur.completion.autoImport": false,
"vetur.validation.template": false,
"vetur.format.defaultFormatterOptions": {
"prettier": {
"trailingComma": "none",
"semi": false,
"singleQuote": true,
"printWidth": 300,
"tabWidth": 2,
"useTabs": false,
"proseWrap": "never",
"bracketSpacing": true,
"jsxBracketSameLine": false,
"arrowParens": "avoid",
"insertPragma": false,
"vueIndentScriptAndStyle": true,
"quoteProps": "as-needed",
"jsxSingleQuote": false,
"requirePragma": false,
"htmlWhitespaceSensitivity": "strict",
"endOfLine": "lf",
},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"js-beautify-html": {
"wrap_attributes": false
}
},
"[vue]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascript]": {
"editor.defaultFormatter": "vscode.typescript-language-features"
},
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[html]": {
"editor.defaultFormatter": "vscode.html-language-features"
},
"[css]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[less]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[scss]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[markdown]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"workbench.colorTheme": "Abyss",
"editor.unicodeHighlight.includeStrings": false,
"stylusSupremacy.insertColons": true,
"stylusSupremacy.insertSemicolons": true,
"stylusSupremacy.insertBraces": true,
"stylusSupremacy.insertNewLineAroundImports": false,
"stylusSupremacy.insertNewLineAroundBlocks": false,
"javascript.format.insertSpaceAfterConstructor": true,
"vetur.format.defaultFormatter.js": "vscode-typescript",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"gitlens.gitCommands.skipConfirmations": [
"fetch:command",
"switch:command"
],
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"workbench.iconTheme": "vscode-icons",
"files.autoSave": "afterDelay",
"breadcrumbs.enabled": false,
"minapp-vscode.disableAutoConfig": true,
"terminal.integrated.fontSize": 15,
"scm.inputFontSize": 15,
}
方案2:
{
"workbench.startupEditor": "newUntitledFile",
"workbench.iconTheme": "vscode-icons",
"workbench.activityBar.visible": true,
"workbench.editor.showTabs": true,
"workbench.editor.enablePreview": false,
"workbench.editor.untitled.hint": "hidden",
"workbench.settings.useSplitJSON": true,
"workbench.colorTheme": "Default Dark+",
"emmet.triggerExpansionOnTab": true,
"emmet.showAbbreviationSuggestions": true,
"emmet.showExpandedAbbreviation": "always",
"emmet.includeLanguages": {
"javascript": "html"
},
"editor.wordWrap": "on",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.tabSize": 2,
"editor.mouseWheelZoom": true,
"liveServer.settings.port": 5500,
"open-in-browser.default": "Chrome",
"git.enabled": false,
"git.ignoreWindowsGit27Warning": true,
"vsicons.dontShowNewVersionMessage": true,
"files.associations": {
"*.vue": "vue",
"*.js": "javascriptreact"
},
"search.exclude": {
"**/node_modules": true,
"**/bower_components": true,
"**/dist": true
},
"terminal.integrated.defaultProfile.windows": "Command Prompt",
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
],
"args": [],
"icon": "terminal-cmd"
},
"Git Bash": {
"source": "Git Bash"
},
"Windows PowerShell": {
"path": "C:\\WINDOWS\\System32\\WindowsPowerShell\\v1.0\\powershell.exe"
}
},
"[vue]": {
"editor.defaultFormatter": "octref.vetur",
"editor.formatOnSave": true
},
"vetur.format.defaultFormatter.js": "vscode-typescript",
"javascript.format.insertSpaceBeforeFunctionParenthesis": true,
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatterOptions": {
"prettier": {
"semi": false,
"singleQuote": true,
"trailingComma": "none",
"bracketSpacing": true,
"tabWidth": 2,
"arrowParens": "avoid"
},
"js-beautify-html": {
"wrap_line_length": 250,
"wrap_attributes": "auto"
}
},
"prettier.semi": false,
"prettier.singleQuote": true,
"prettier.trailingComma": "none",
}