-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
85 lines (84 loc) · 2.65 KB
/
.eslintrc.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
module.exports = {
parserOptions: {
ecmaVersion: 6,
sourceType: 'module',
"parser": "babel-eslint"
},
env: {
browser: true,
node: true,
es6: true,
},
extends: [
/* vue 2 配置 */
// 'plugin:vue/recommended',
'plugin:vue/essential',
// 'plugin:vue/strongly-recommended',
/* vue 3 配置 */
// "plugin:vue/vue3-recommended"
// "plugin:vue/vue3-essential"
// "plugin:vue/vue3-strongly-recommended"
],
plugins: ['vue'],
rules: {
"no-multiple-empty-lines": ["warn", { "max": 1}],
"global-require": 0,
"spaced-comment": 1,//注释空格
"no-trailing-spaces": 1,//一行结束后面不要有空格
"arrow-spacing": 1,//=>的前/后括号
"no-multi-spaces": 1,//不能用多余的空格
"space-before-blocks": [1, "always"],//不以新行开始的块{前面要不要有空格
"max-len": [1,120],
"dot-notation": 1,
"key-spacing": [1, { "beforeColon": false, "afterColon": true }],//对象字面量中冒号的前后空格
"space-infix-ops": [1],//一元运算符两边空格
"comma-spacing": [1],//逗号后边空格
"keyword-spacing": [1],// if else 空格
"semi-spacing": [1, {"before": false, "after": true}],//分号前后空格
// 官方已经有对应规则
"no-underscore-dangle": [1],
"no-console": "off",
"consistent-return": 1,
"camelcase": 0,
"no-empty-function": 1,
"no-use-before-define": "off",
"complexity": "off",
"no-lonely-if": "warn",
"new-cap": "warn",
'indent': ['warn', 4],
'indent': ['warn', 4],
'vue/html-indent': ['warn', 4],
'vue/html-closing-bracket-newline': 'warn',
'vue/max-attributes-per-line': [1, {
singleline: 4,
multiline: {
max: 1,
allowFirstLine: false
}
}],
'vue/order-in-components': [1, {
order: [
'el',
'name',
'parent',
'functional',
['delimiters', 'comments'],
['components', 'directives', 'filters'],
'extends',
'mixins',
'inheritAttrs',
'model',
['props', 'propsData'],
'fetch',
'asyncData',
'data',
'computed',
'watch',
'LIFECYCLE_HOOKS',
'methods',
['template', 'render'],
'renderError'
]
}],
},
};