-
Notifications
You must be signed in to change notification settings - Fork 3
/
.eslintrc.json
252 lines (169 loc) · 5.86 KB
/
.eslintrc.json
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
{
// Make this configuration file as the root one
"root": true,
// Extends eslint recommended rules
"extends": [
"eslint:recommended",
"plugin:node/recommended"
],
"env": {
// Add browser environment globals
"browser": true,
// Add node.js environment globals
"node": true,
// Enable ECMAScript 2017 features
"es2017": true
},
"globals": {
// Add angular to environment globals but do not authorize to overwrite it
"angular": false
},
"rules": {
// Disallow unused vars but not unused arguments
"no-unused-vars": [2, {"vars": "local", "args": "none"}],
// Treat var as block scoped
"block-scoped-var": 2,
// Require default case in switch statements
"default-case": 2,
// Disallow use of alert
"no-alert": 2,
// Disallow use of caller/callee
"no-caller": 2,
// Disallow null comparisons
"no-eq-null": 2,
// Disallow eval()
"no-eval": 2,
// Disallow adding to native types
"no-extend-native": 2,
// Disallow unnecessary function binding
"no-extra-bind": 2,
// Disallow floating decimals
"no-floating-decimal": 2,
// Disallow the type conversion with shorter notations
"no-implicit-coercion": 2,
// Disallow implied eval
"no-implied-eval": 2,
// Disallow Iterator
"no-iterator": 2,
// Disallow labeled statements
"no-labels": 2,
// Disallow unnecessary nested blocks
"no-lone-blocks": 2,
// Disallow multiple spaces
"no-multi-spaces": 2,
// Disallow multiline strings
"no-multi-str": 2,
// Disallow reassignment of native objects
"no-native-reassign": 2,
// Disallow function constructor
"no-new-func": 2,
// Disallow octal escapes
"no-octal-escape": 2,
// Disallow octal literals
"no-octal": 2,
// Disallow use of __proto__
"no-proto": 2,
// Disallow script URLs
"no-script-url": 2,
// Disallow self compare
"no-self-compare": 2,
// Restrict what can be thrown as an exception
"no-throw-literal": 2,
// Disallow unused expressions
"no-unused-expressions": [2, {"allowShortCircuit": true, "allowTernary": true}],
// Disallow unnecessary .call() and .apply()
"no-useless-call": 2,
// Disallow unncessary concatenation of strings
"no-useless-concat": 2,
// No with statements
"no-with": 2,
// Strict mode
"strict": [2, "global"],
// Disallow shadowing of variables inside of catch
"no-catch-shadow": 2,
// Disallow variables deletion
"no-delete-var": 2,
// Disallow shadowing of restricted names
"no-shadow-restricted-names": 2,
// Disallow early use
"no-use-before-define": 2,
// Disallow spaces inside of brackets
"array-bracket-spacing": 2,
// Disallow spaces inside of single line blocks
"block-spacing": [2, "always"],
// Require brace style
"brace-style": [2, "1tbs", { "allowSingleLine": false }],
// Require camelcase
"camelcase": [2, {"properties": "always"}],
// Enforces spacing around commas
"comma-spacing": [2, {"before": false, "after": true}],
// Comma style
"comma-style": [2, "last"],
// Disallow spaces inside of computed properties
"computed-property-spacing": [2, "never"],
// Require consistent this
"consistent-this": [2, "self"],
// Require file to end with single newline
"eol-last" : 2,
// Validate Indentation
"indent": [2, 2, {"SwitchCase": 1, "VariableDeclarator": { "var": 1, "let": 1, "const": 1}}],
// Enforce property spacing
"key-spacing": [2, {"beforeColon": false, "afterColon": true}],
// Enforce empty lines around comments
"lines-around-comment": [2, { "beforeBlockComment": true, "beforeLineComment": true, "allowBlockStart": true, "allowBlockEnd": true }],
// Require constructors to use initial caps
"new-cap": [2, {"newIsCap": true, "capIsNew": false}],
// Require parens for constructors
"new-parens": 2,
// Disallow if as the only statement in an else block
"no-lonely-if": 2,
// Disallow if as the only statement in an else block
"no-mixed-spaces-and-tabs": 2,
// Disallows multiple blank lines
"no-multiple-empty-lines": [2, {"max": 2}],
// Disallow spaces in function calls
"no-spaced-func": 2,
// Disallow trailing spaces at the end of lines
"no-trailing-spaces": 2,
// Disallow spaces inside of curly braces in objects.
"object-curly-spacing": 2,
// Operator linebreak
"operator-linebreak": [2, "after"],
// Quoting style for property names
"quote-props": [2, "as-needed"],
// Enforce quote style
"quotes": [2, "single"],
// Require JSDoc comment
"require-jsdoc": 2,
// Enforce spacing before and after semicolons
"semi-spacing": 2,
// Enforce semicolons
"semi": 2,
// Require spaces following keywords
"keyword-spacing": 2,
// Require or disallow space before blocks
"space-before-blocks": 2,
// Disallow a space before function parenthesis
"space-before-function-paren": [2, "never"],
// Disallow spaces inside of parentheses
"space-in-parens": 2,
// Require spaces around infix operators
"space-infix-ops": 2,
// Require or disallow spaces before/after unary operators
"space-unary-ops": [2, { "words": true, "nonwords": false }],
// Requires or disallows a whitespace (space or tab) beginning a comment
"spaced-comment": [2, "always"],
// Limit Maximum Length of Line
"max-len": [2, 120, 2, {"ignoreUrls": true}],
// Disallow mixed requires
"node/no-mixed-requires": 2,
// Disallow new require
"node/no-new-require": 2,
// Disallow string concatenation when using _dirname and _filename
"node/no-path-concat": 2,
// Disallow process.exit()
"node/no-process-exit": 2,
// Disallow synchronous methods
"node/no-sync": 2
}
}