This repository has been archived by the owner on Dec 13, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc
123 lines (120 loc) · 2.93 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
{
"env": {
"browser": true,
"commonjs": true,
"es6": true,
"node": true
},
"globals": {
"XDomainRequest": true,
"window": true,
"wx": true
},
"extends": "eslint:recommended",
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 7,
"ecmaFeatures": {
// lambda表达式
"arrowFunctions": true,
// 解构赋值
"destructuring": true,
// class
"classes": true,
// http://es6.ruanyifeng.com/#docs/function#函数参数的默认值
"defaultParams": true,
// 块级作用域,允许使用let const
"blockBindings": true,
// 允许使用模块,模块内默认严格模式
"modules": true,
// 允许字面量定义对象时,用表达式做属性名
// http://es6.ruanyifeng.com/#docs/object#属性名表达式
"objectLiteralComputedProperties": true,
// 允许对象字面量方法名简写
/*var o = {
method() {
return "Hello!";
}
};
等同于
var o = {
method: function() {
return "Hello!";
}
};
*/
"objectLiteralShorthandMethods": true,
/*
对象字面量属性名简写
var foo = 'bar';
var baz = {foo};
baz // {foo: "bar"}
// 等同于
var baz = {foo: foo};
*/
"objectLiteralShorthandProperties": true,
// http://es6.ruanyifeng.com/#docs/function#rest参数
"restParams": true,
// http://es6.ruanyifeng.com/#docs/function#扩展运算符
"spread": true,
// http://es6.ruanyifeng.com/#docs/iterator#for---of循环
"forOf": true,
// http://es6.ruanyifeng.com/#docs/generator
"generators": true,
// http://es6.ruanyifeng.com/#docs/string#模板字符串
"templateStrings": true,
"superInFunctions": true,
// http://es6.ruanyifeng.com/#docs/object#对象的扩展运算符
"experimentalObjectRestSpread": true,
"experimentalDecorators": true
},
"sourceType": "module"
},
"rules": {
"indent": [ 1, 2, {
"SwitchCase": 1
}
],
// 文件末尾强制换行
"eol-last": 1,
// 使用 === 替代 ==
"eqeqeq": [
1,
"allow-null"
],
// 控制逗号在行尾出现还是在行首出现
// http://eslint.org/docs/rules/comma-style
"comma-style": [
1,
"last"
],
"linebreak-style": [
1,
"unix"
],
"quotes": [
1,
"single"
],
"semi": [
1,
"never"
],
"no-extra-semi": 0,
"semi-spacing": 0,
"no-alert": 0,
"no-array-constructor": 1,
"no-caller": 1,
"no-catch-shadow": 0,
"no-cond-assign": 1,
"no-console": 0,
"no-constant-condition": 0,
"no-continue": 0,
"no-control-regex": 1,
"no-debugger": 1,
"no-delete-var": 1,
"no-mixed-spaces-and-tabs": 1,
"no-unused-vars": 1,
"comma-dangle": 1
}
}