-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
67 lines (67 loc) · 1.63 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
module.exports = {
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
'globals': {
// Compile-time defines
'__USE_SUBTITLES__': false,
'__USE_ALT_AUDIO__': false,
'__USE_EME_DRM__': false
},
"extends": "standard",
"parserOptions": {
"ecmaVersion": 2015,
"sourceType": "module"
},
"rules": {
"indent": [
"error",
2
],
"quotes": [
"error",
"single"
],
"semi": 2,
// 空的构造函数
"no-useless-constructor": 0,
// 是否允许使用控制台输出
"no-console": 0,
//未使用变量
"no-unused-vars": 1,
// 变量前加修饰符 var let const 等
"no-undef": 1,
//避免重复类成员
"no-dupe-class-members": 2,
// 禁止重复导入
"no-duplicate-imports": 2,
// 禁止链式定义 let a = b = c = 1
"no-multi-assign": 1,
// 禁止使用 自增、自减
"no-plusplus": 1,
// 判断是否相等用 === 或 !==
"eqeqeq": 1,
// 三目运算符 单行
"no-nested-ternary": 1,
// 所有注释开头空一个
"spaced-comment": 1,
// 用空格来隔开运算符
"space-infix-ops": 1,
// 花括号里加空格
"object-curly-spacing": 1,
// , 前不要空格, , 后需要空格
"comma-spacing": 1,
// "sort-imports": 1,
// 禁止 function 标识符和括号之间出现空格
"no-spaced-func": 1,
// 强制在 function的左括号之前使用一致的空格
"space-before-function-paren": 0,
// 只读类原型不可添加属性
"no-extend-native": 0,
// 类名首字母大写
"new-cap": 1
}
};