还是记一下记一下
vscode 配置:
{
"editor.fontSize": 15,
"editor.formatOnType": true,
"workbench.colorCustomizations": {
"colors": "#a33d02",
"activityBar.background": "#a33d02",
"list.list.activeSelectionBackground": "#ff3e03"
},
"workbench.iconTheme": "material-icon-theme",
"editor.quickSuggestions": {
"other": true,
"comments": false,
"strings": false
},
"terminal.integrated.fontSize": 15,
"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": "
",
"editor.formatOnSave": true,
"javascript.format.enable": false,
"eslint.alwaysShowStatus": true,
"eslint.options": {
"extensions": [
".html",
".js",
".jsx",
".vue"
]
},
"eslint.validate": [
"javascript",
"html",
"vue"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"vetur.format.defaultFormatter.html": "js-beautify-html",
"vetur.format.options.tabSize": 4,
"vetur.format.options.useTabs": true,
"vetur.validation.template": true,
"vetur.format.defaultFormatterOptions": {
"js-beautify-html": {
"wrap_attributes": "force-aligned" //属性强制折行对齐
},
"prettier": {
"singleQuote": true,
"trailingComma": 1,
}
}
}
eslint配置:
module.exports = {
parser: 'vue-eslint-parser',
env: {
browser: true,
es6: true,
node: true
},
extends: 'semistandard',
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
ecmaVersion: 8
},
rules: {
'no-return-await': 'off',
'camelcase': 2,
'no-console': 'off',
"no-tabs": 0,
indent: [
'error',
4,
{
SwitchCase: 1
}
],
'linebreak-style': [
'error',
'unix'
],
quotes: [
1,
'single'
],
semi: [
1,
'always'
],
'no-console': 1,
'space-before-function-paren': 0,
'no-multiple-empty-lines': [
'off'
]
},
globals: {
$: true,
__BROWSER__: true,
__DEV__: true,
__SIT__: true,
__UAT__: true,
__PROD__: true,
__DEBUG_UAT__: true,
__DEBUG_PROD__: true,
__VPC__: true,
describe: true,
it: true,
BMap: true,
document: true,
window: true
}
};
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"