-
Notifications
You must be signed in to change notification settings - Fork 1
/
.eslintrc
55 lines (55 loc) · 1.78 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
{
"extends": "eslint:recommended",
"env": {
"browser": true
},
"globals": {
"Framework7": true,
"Dom7": true,
"device": true,
"FileUploadOptions": true,
"FileTransfer": true,
"ContactFindOptions": true,
"ContactField": true,
"StatusBar": true,
"cordova": true,
"Media": true,
"Connection": true,
"LocalFileSystem": true,
"Template7": true,
"Swiper": true
},
"parserOptions": {
"sourceType": "module"
},
"rules": { //0 off, 1 warn, 2 error
"no-constant-condition": 2,
"no-alert": 1,
"no-console": 0,
"no-debugger": 2, // 程序中不能出现debugger
"no-dupe-args": 2, // 函数的参数名称不能重复
"no-dupe-keys": 2, // 对象的属性名称不能重复
"no-duplicate-case": 2, // switch的case不能重复
"no-func-assign": 2,
"no-obj-calls": 2,
"no-regex-spaces": 2,
"no-sparse-arrays": 2, //disallow sparse arrays, e.g.[,,]
"no-unexpected-multiline": 2,
"no-unreachable": 2,
"use-isnan": 2, //require calls to isNaN() when checking for NaN
"valid-typeof": 2, //enforce comparing typeof expressions against valid strings
"eqeqeq": 0, //Require === and !==
"no-caller": 0, //Disallow Use of caller/callee
"no-eval": 1,
"no-redeclare": 2,
"no-undef": 2,
"no-unused-vars": 1,
"no-use-before-define": 2,
"comma-dangle": [1, "never"], //require or disallow trailing commas
"no-const-assign": 2, //if, while等条件中不允许使用“=”
"no-class-assign": 2, //Disallow modifying variables of class declarations
"no-confusing-arrow": 2, //Disallow arrow functions where they could be confused with comparisons
"no-catch-shadow": 2, //Disallow Shadowing of Variables Inside of catch
"no-dupe-class-members": 2 //Disallow duplicate name in class members
}
}