-
-
Notifications
You must be signed in to change notification settings - Fork 76
/
.eslintrc
215 lines (215 loc) · 4.46 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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
{
"env": {
"es6": true,
"node": true,
"mocha": true
},
"extends": [
"eslint:recommended"
],
"parserOptions": {
"ecmaVersion": 6,
"sourceType": "module"
},
"globals": {
"XMLSerializer": true,
"Blob": true,
"Image": true,
"Promise": true,
"XMLHttpRequest": true,
"FileReader": true,
"HTMLElement": true,
"CanvasRenderingContext2D": true,
"Worker": true,
"URL": true
},
"plugins": [
"promise",
"import-order",
"jsdoc"
],
"rules": {
"indent": 0,
// "prefer-const": "error",
// "no-var": "error",
"prefer-arrow-callback": "error",
"arrow-parens": 0,
"strict": [
// use strict mode
"error",
"global"
],
"no-unused-vars": [
"error",
{
"argsIgnorePattern": "^_"
}
],
"no-constant-condition": [
"error"
],
"no-multi-spaces": 0,
"semi": [
// semicolons are required
"error",
"always"
],
"max-len": [
// max line length is 120 chars (except for comments)
"error",
120,
{
"ignoreComments": true
}
],
"eol-last": [
// \n is required at the end of the file
"error",
"always"
],
"camelcase": [
// enforce camelcase style for variable names and property names
"error",
{
"properties": "always"
}
],
"dot-notation": [
// always use the dot notation to access properties, except if property contains '_'
"error",
{
"allowPattern": "^.*_.*$"
}
],
"quotes": [
// use single quotes (or backticks if there is a substitution)
"error",
"single"
],
"comma-dangle": [
// no trailing commas in object or array literals
"error",
"never"
],
"no-multi-str": [
// no multi line strings using \
"error"
],
"no-multiple-empty-lines": [
"error"
],
"no-trailing-spaces": [
"error"
],
"no-mixed-spaces-and-tabs": [
"error"
],
"curly": 0,
"brace-style": 0,
"keyword-spacing": [
// in `} else {` both spaces are required (in general, around keywords)
"error",
{
"before": true,
"after": true,
"overrides": {
"catch": {
"before": true,
"after": false
}
}
}
],
"space-before-blocks": [
// in `if (foo) {` the second space is required
"error",
"always"
],
"arrow-spacing": [
// in `(foo) => {` both spaces are required
"error",
{
"before": true,
"after": true
}
],
"operator-linebreak": [
// linebreak goes after the operator except for '?' and ':'
"error",
"after",
{
"overrides": {
"?": "before",
":": "before"
}
}
],
"space-unary-ops": [
// space is required for new, delete, etc. but not for +, -, ++, --, etc.
"error",
{
"words": true,
"nonwords": false,
"overrides": {
"typeof": false
// also no space for typeof(...)
}
}
],
"space-infix-ops": [
// space is required around infix operators, e.g: 'a + b'
"error"
],
"comma-spacing": [
// space is required after a comma
"error",
{
"after": true
}
],
"array-bracket-spacing": 0,
"space-in-parens": [
// '( x + y )' is not allowed, use '(x + y)'
"error",
"never"
],
"key-spacing": 0,
"yoda": [
// disallow yoda conditions, e.g. `(true === foo)`
"error",
"never"
],
"no-with": [
// the with statements is not allowed
"error"
],
"linebreak-style": [
// use unix linebreak '\n'
"error",
"unix"
],
"wrap-iife": [
// require IIFE to be wrapped in parenthesis
"error"
],
"func-call-spacing": [
// no space between the function name and the opening parenthesis on invocation
"error",
"never"
],
"space-before-function-paren": 0,
"no-cond-assign": [
// no assignment operators in if, for and while except if enclosed in parentheses
"error",
"except-parens"
],
"no-inner-declarations": [
"error"
],
"no-console": 2,
// `console.log(...)` is allowed
"import-order/import-order": 0,
// import order is not enfored
"no-case-declarations": 0
}
}