-
-
Notifications
You must be signed in to change notification settings - Fork 487
/
.eslintrc
64 lines (64 loc) · 1.41 KB
/
.eslintrc
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
{
"extends": [
"eslint:recommended",
"plugin:import/errors",
"plugin:import/warnings",
"plugin:promise/recommended"
],
"plugins": [
"import",
"promise"
],
"env": {
"node": true,
"es2017": true,
"browser": true,
"commonjs": true
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "module"
},
"globals": {
"Component": true,
"Page": true,
"wx": true,
"App": true,
"getCurrentPages":true,
"Behavior": true
},
"ignorePatterns": [
"dist/*",
"examples/dist/*",
"src/common/async-validator/*",
"examples/pages/filter/components/wemark"
],
"rules": {
// 函数大括号前不允许加空格(已关闭)
"space-before-function-paren": "off",
// 缩进 2 个空格
"indent": ["error", 2],
// 必须使用单引号
"quotes": [
"error", "single", {
"allowTemplateLiterals": false
}
],
// 行尾必须添加分号
"semi": ["error"],
// 不允许使用 console.log()
"no-console": [
"warn", {
"allow": ["info", "warn", "error"]
}
],
// 禁止使用未声明的变量
"no-undef": "error",
// 禁止不必要的转义使用(已关闭)
"no-useless-escape": "off",
// 必须使用严格等于
"eqeqeq": ["error", "always"],
// promise 中必须要 return 语句(已关闭)
"promise/always-return": "off"
}
}