- .eslintrc.js
module.exports = {
root: true,
env: {
node: true
},
extends: ['plugin:vue/essential', 'eslint:recommended', 'plugin:prettier/recommended'],
parserOptions: {
parser: '@babel/eslint-parser'
},
rules: {
'generator-star-spacing': 'off',
'space-before-function-paren': 0,
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'prettier/prettier': [
'error',
{
endOfLine: 'auto'
}
],
'vue/multi-word-component-names': 'off'
}
}
prettier.config.js
module.exports = {
printWidth: 120,
tabWidth: 2,
// useTabs: false,
semi: false,
singleQuote: true,
// quoteProps: 'as-needed',
// jsxSingleQuote: false,
trailingComma: 'none',
// bracketSpacing: true,
arrowParens: 'always' //始终将箭头函数用()包裹
// endOfLine: 'lf'
}
本地settings.json
// {
// "files.associations": {
// "*.cjson": "jsonc",
// "*.wxss": "css",
// "*.wxs": "javascript"
// },
// "emmet.includeLanguages": {
// "wxml": "html"
// },
// "minapp-vscode.disableAutoConfig": true,
// "workbench.colorTheme": "Monokai Pro (Filter Octagon)",
// "workbench.iconTheme": "Monokai Pro (Filter Octagon) Icons",
// "window.zoomLevel": 0,
// "editor.fontSize": 18,
// "files.autoSave": "afterDelay"
// }
{
"editor.quickSuggestions": {
"strings": true
},
"eslint.validate": [
"javascript",
{
"language": "vue",
"autoFix": true
},
"html",
"vue"
],
"explorer.confirmDelete": false,
//"html.format.wrapAttributes": "preserve",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_line_length": 200,
"wrap_attributes": "auto",
"end_with_newline": false,
}
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"editor.fontSize": 18,
"editor.accessibilityPageSize": 19,
"files.associations": {
"*.cjson": "jsonc",
"*.wxss": "css",
"*.wxs": "javascript"
},
"emmet.includeLanguages": {
"wxml": "html"
},
"minapp-vscode.disableAutoConfig": true,
"rest-client.excludeHostsForProxy": [],
"css.fileExtensions": [
"css",
"scss"
],
"eslint.nodePath": "",
"search.followSymlinks": false,
"git.confirmSync": false,
"eslint.codeAction.showDocumentation": {
"enable": true
},
"editor.tabSize": 2,
"eslint.alwaysShowStatus": true,
"leek-fund.fundSort": -2,
"cssrem.rootFontSize": 50,
"leek-fund.statusBarStock": [
"sh000001"
],
"css.styleSheets": [
],
"eslint.nodeEnv": "Code Cache/",
"diffEditor.ignoreTrimWhitespace": false,
"vetur.ignoreProjectWarning": true,
"editor.unicodeHighlight.ambiguousCharacters": false,
"leek-fund.funds": [
[]
],
"eslint.rules.customizations": [
],
"leek-fund.stocks": [
"sh000001",
"sh000300",
"sh000016",
"sh000688",
"hk03690",
"hk00700",
"usr_ixic",
"usr_dji",
"usr_inx",
"nf_ZC0",
"nf_IC0",
"hf_OIL",
"hf_CHA50CFD",
"sz000333"
],
"files.autoSave": "afterDelay",
"explorer.confirmDragAndDrop": false,
"eslint.codeActionsOnSave.rules": null
}
vscode 共享配置
-
项目推荐安装插件
-
settings.json 把上面本地的 settings.json 配置到项目中即可