我的vscode配置和eslint配置
还是记一下记一下
vscode 配置:
{
"workbench.colorTheme": "Monokai Dimmed",
"workbench.colorCustomizations": {
"colors": "#a33d02",
"activityBar.background": "#a33d02",
"list.list.activeSelectionBackground": "#ff3e03"
},
"workbench.iconTheme": "material-icon-theme",
//
"editor.fontSize": 15,
"editor.formatOnType": true,
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},
//
"terminal.integrated.fontSize": 15,
"terminal.integrated.profiles.linux": {
"bash": {
"path": "bash",
"icon": "terminal-bash"
},
"zsh": {
"path": "zsh"
},
"fish": {
"path": "fish"
},
"tmux": {
"path": "tmux",
"icon": "terminal-tmux"
},
"pwsh": {
"path": "pwsh",
"icon": "terminal-powershell"
}
},
"terminal.integrated.defaultProfile.windows": "Git Bash",
"terminal.integrated.env.windows": {
"PYTHONPATH": "${workspaceFolder};${env:PYTHONPATH}"
},
//
"todo-tree.highlights.defaultHighlight": {
"icon": "checklist",
"type": "text",
"foreground": "white",
"background": "#ffab00",
"borderRadius": "2px",
"gutterIcon": true,
"iconColour": "#ffab00"
},
"todo-tree.highlights.customHighlight": {
"FIXME": {
"background": "#FF69B4",
"icon": "alert",
"iconColour": "#FF69B4"
}
},
"todo-tree.general.tags": [
"BUG",
"HACK",
"FIXME",
"TODO",
"XXX",
"[ ]",
"[x]"
],
"todo-tree.regex.regex": "(//|#|<!--|;|/\\*|^|^\\s*(-|\\d+.))\\s*($TAGS)",
//
"javascript.updateImportsOnFileMove.enabled": "always",
"files.eol": "\n",
"javascript.format.enable": true,
//
"editor.defaultFormatter": "dbaeumer.vscode-eslint",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "always",
},
"eslint.autoFixOnSave":true,
"eslint.run":"onSave",
"eslint.format.enable": true,
// "eslint.alwaysShowStatus": false,
// "eslint.options": {
// "extensions": [
// ".html",
// ".js",
// ".jsx",
// ".vue"
// ]
// },
"eslint.validate": [
"javascript",
"html",
"vue"
],
"[javascript]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "vscode.typescript-language-features",
"editor.maxTokenizationLineLength": 2500
},
"javascript.format.semicolons": "insert",
"[vue]": {
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit",
"source.fixAll": "explicit"
},
"editor.defaultFormatter": "Vue.volar",
},
"[python]": {
"editor.defaultFormatter": "ms-python.black-formatter",
},
//
"vetur.validation.template": true,
"vetur.validation.script": true,
"vetur.validation.style": true,
"vetur.useWorkspaceDependencies": true,
"vetur.format.defaultFormatter.js": "vscode-typescript",
"vetur.format.defaultFormatter.css": "prettier",
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.options.tabSize": 4,
"vetur.format.options.useTabs": true,
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned" //属性强制折行对齐
},
"prettier": {
"singleQuote": true,
"trailingComma": 1,
}
},
}
eslint package.js
"eslint": "^5.16.0",
"babel-eslint": "^10.1.0",
"eslint-plugin-vue": "^6.2.2",
"eslint-config-semistandard": "^16.0.0",
"eslint-config-standard": "^12.0.0",
"eslint-plugin-import": "^2.16.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-promise": "^4.1.1",
"eslint-plugin-standard": "^4.0.0"