-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.json
78 lines (74 loc) · 2.74 KB
/
.eslintrc.json
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
module.exports = {
root: true,
env: {
node: true
},
rules: {
'no-console': process.env.NODE_ENV === 'production'?'error':'off',
'no-debugger': process.env.NODE_ENV === 'production'?'error':'off',
'vue/camelcase': 'off', // 驼峰命名
'vue/space-infix-ops': 'off',
'no-unused-vars':'off',
'no-useless-escape':'off',
'vue/no-use-v-if-with-v-for':'off', //v-for,v-if 不能同时用在一个元件上
'vue/no-parsing-error':'off',
'vue/no-boolean-default': 'off', // 布尔值属性默认值必须是false
'vue/max-attributes-per-line': 'off', // 一行一个属性
'vue/eqeqeq': 'error', // 要用===
'no-empty':'warn', // 不允许有空的代码段
'vue/require-v-for-key':'warn', // v-for必须要有key
'vue/require-default-prop': 'warn',// 组件prop 必须有默认值
'vue/require-prop-types': 'warn', // 组件prop 必须有类型
'vue/valid-v-for':'error', // v-for 有效检测
'vue/no-confusing-v-for-v-if': 'error', // v-if 必须在v-for之后 因为v-for 优先级大于v-if
'no-constant-condition':'error',
'vue/attribute-hyphenation': 'error',
'vue/html-closing-bracket-newline': 'error',
'vue/html-closing-bracket-spacing': 'error',
'vue/html-end-tags': 'error',
'vue/html-indent': 'error',
'vue/html-quotes': 'error',
'vue/html-self-closing': 'error',
'vue/multiline-html-element-content-newline': 'error',
'vue/mustache-interpolation-spacing': 'error',
'vue/name-property-casing': 'error',
'vue/no-multi-spaces': 'error',
'vue/no-spaces-around-equal-signs-in-attribute': 'error',
'vue/no-template-shadow': 'error',
'vue/prop-name-casing': 'error',
'vue/singleline-html-element-content-newline': 'error',
'vue/v-bind-style': 'error',
'vue/v-on-style': 'error',
'vue/attributes-order': 'error',
'vue/no-v-html': 'error',
'vue/order-in-components': 'error',
'vue/this-in-template': 'error',
'vue/array-bracket-spacing': 'error',
'vue/arrow-spacing': 'error',
'vue/block-spacing': 'error',
'vue/brace-style': 'error',
'vue/comma-dangle': 'error',
'vue/component-name-in-template-casing': 'error',
'vue/key-spacing': 'error',
'vue/match-component-file-name': 'error',
'vue/no-restricted-syntax': 'error',
'vue/object-curly-spacing': 'error',
'vue/require-direct-export': 'error',
'vue/script-indent': 'error',
'vue/space-unary-ops': 'error',
'vue/v-on-function-call': 'error'
},
globals: { // 声明全局变量不需要检测
"uni": "writable",
"wx": "writable",
"_hmt": "writable",
"BMap": "writable",
},
parserOptions: {
parser: 'babel-eslint'
},
'extends': [
'plugin:vue/essential',
'eslint:recommended'
]
}