@@ -15,9 +15,12 @@ module.exports = {
15
15
16
16
// enforce that class methods use "this"
17
17
// https://eslint.org/docs/rules/class-methods-use-this
18
- 'class-methods-use-this' : [ 'error' , {
19
- exceptMethods : [ ] ,
20
- } ] ,
18
+ 'class-methods-use-this' : [
19
+ 'error' ,
20
+ {
21
+ exceptMethods : [ ] ,
22
+ } ,
23
+ ] ,
21
24
22
25
// require return statements to either always or never specify values
23
26
'consistent-return' : 'error' ,
@@ -80,13 +83,12 @@ module.exports = {
80
83
81
84
// disallow empty functions, except for standalone funcs/arrows
82
85
// https://eslint.org/docs/rules/no-empty-function
83
- 'no-empty-function' : [ 'error' , {
84
- allow : [
85
- 'arrowFunctions' ,
86
- 'functions' ,
87
- 'methods' ,
88
- ]
89
- } ] ,
86
+ 'no-empty-function' : [
87
+ 'error' ,
88
+ {
89
+ allow : [ 'arrowFunctions' , 'functions' , 'methods' ] ,
90
+ } ,
91
+ ] ,
90
92
91
93
// disallow empty destructuring patterns
92
94
// https://eslint.org/docs/rules/no-empty-pattern
@@ -122,12 +124,15 @@ module.exports = {
122
124
123
125
// disallow implicit type conversions
124
126
// https://eslint.org/docs/rules/no-implicit-coercion
125
- 'no-implicit-coercion' : [ 'off' , {
126
- boolean : false ,
127
- number : true ,
128
- string : true ,
129
- allow : [ ] ,
130
- } ] ,
127
+ 'no-implicit-coercion' : [
128
+ 'off' ,
129
+ {
130
+ boolean : false ,
131
+ number : true ,
132
+ string : true ,
133
+ allow : [ ] ,
134
+ } ,
135
+ ] ,
131
136
132
137
// disallow var and named functions in global scope
133
138
// https://eslint.org/docs/rules/no-implicit-globals
@@ -153,17 +158,23 @@ module.exports = {
153
158
154
159
// disallow magic numbers
155
160
// https://eslint.org/docs/rules/no-magic-numbers
156
- 'no-magic-numbers' : [ 'off' , {
157
- ignore : [ ] ,
158
- ignoreArrayIndexes : true ,
159
- enforceConst : true ,
160
- detectObjects : false ,
161
- } ] ,
161
+ 'no-magic-numbers' : [
162
+ 'off' ,
163
+ {
164
+ ignore : [ ] ,
165
+ ignoreArrayIndexes : true ,
166
+ enforceConst : true ,
167
+ detectObjects : false ,
168
+ } ,
169
+ ] ,
162
170
163
171
// disallow use of multiple spaces
164
- 'no-multi-spaces' : [ 'error' , {
165
- ignoreEOLComments : false ,
166
- } ] ,
172
+ 'no-multi-spaces' : [
173
+ 'error' ,
174
+ {
175
+ ignoreEOLComments : false ,
176
+ } ,
177
+ ] ,
167
178
168
179
// disallow use of multiline strings
169
180
'no-multi-str' : 'error' ,
@@ -187,21 +198,24 @@ module.exports = {
187
198
// disallow reassignment of function parameters
188
199
// disallow parameter object manipulation except for specific exclusions
189
200
// rule: https://eslint.org/docs/rules/no-param-reassign.html
190
- 'no-param-reassign' : [ 'error' , {
191
- props : true ,
192
- ignorePropertyModificationsFor : [
193
- 'acc' , // for reduce accumulators
194
- 'accumulator' , // for reduce accumulators
195
- 'e' , // for e.returnvalue
196
- 'ctx' , // for Koa routing
197
- 'req' , // for Express requests
198
- 'request' , // for Express requests
199
- 'res' , // for Express responses
200
- 'response' , // for Express responses
201
- '$scope' , // for Angular 1 scopes
202
- 'staticContext' , // for ReactRouter context
203
- ]
204
- } ] ,
201
+ 'no-param-reassign' : [
202
+ 'error' ,
203
+ {
204
+ props : true ,
205
+ ignorePropertyModificationsFor : [
206
+ 'acc' , // for reduce accumulators
207
+ 'accumulator' , // for reduce accumulators
208
+ 'e' , // for e.returnvalue
209
+ 'ctx' , // for Koa routing
210
+ 'req' , // for Express requests
211
+ 'request' , // for Express requests
212
+ 'res' , // for Express responses
213
+ 'response' , // for Express responses
214
+ '$scope' , // for Angular 1 scopes
215
+ 'staticContext' , // for ReactRouter context
216
+ ] ,
217
+ } ,
218
+ ] ,
205
219
206
220
// disallow usage of __proto__ property
207
221
'no-proto' : 'error' ,
@@ -211,45 +225,57 @@ module.exports = {
211
225
212
226
// disallow certain object properties
213
227
// https://eslint.org/docs/rules/no-restricted-properties
214
- 'no-restricted-properties' : [ 'error' , {
215
- object : 'arguments' ,
216
- property : 'callee' ,
217
- message : 'arguments.callee is deprecated' ,
218
- } , {
219
- object : 'global' ,
220
- property : 'isFinite' ,
221
- message : 'Please use Number.isFinite instead' ,
222
- } , {
223
- object : 'self' ,
224
- property : 'isFinite' ,
225
- message : 'Please use Number.isFinite instead' ,
226
- } , {
227
- object : 'window' ,
228
- property : 'isFinite' ,
229
- message : 'Please use Number.isFinite instead' ,
230
- } , {
231
- object : 'global' ,
232
- property : 'isNaN' ,
233
- message : 'Please use Number.isNaN instead' ,
234
- } , {
235
- object : 'self' ,
236
- property : 'isNaN' ,
237
- message : 'Please use Number.isNaN instead' ,
238
- } , {
239
- object : 'window' ,
240
- property : 'isNaN' ,
241
- message : 'Please use Number.isNaN instead' ,
242
- } , {
243
- property : '__defineGetter__' ,
244
- message : 'Please use Object.defineProperty instead.' ,
245
- } , {
246
- property : '__defineSetter__' ,
247
- message : 'Please use Object.defineProperty instead.' ,
248
- } , {
249
- object : 'Math' ,
250
- property : 'pow' ,
251
- message : 'Use the exponentiation operator (**) instead.' ,
252
- } ] ,
228
+ 'no-restricted-properties' : [
229
+ 'error' ,
230
+ {
231
+ object : 'arguments' ,
232
+ property : 'callee' ,
233
+ message : 'arguments.callee is deprecated' ,
234
+ } ,
235
+ {
236
+ object : 'global' ,
237
+ property : 'isFinite' ,
238
+ message : 'Please use Number.isFinite instead' ,
239
+ } ,
240
+ {
241
+ object : 'self' ,
242
+ property : 'isFinite' ,
243
+ message : 'Please use Number.isFinite instead' ,
244
+ } ,
245
+ {
246
+ object : 'window' ,
247
+ property : 'isFinite' ,
248
+ message : 'Please use Number.isFinite instead' ,
249
+ } ,
250
+ {
251
+ object : 'global' ,
252
+ property : 'isNaN' ,
253
+ message : 'Please use Number.isNaN instead' ,
254
+ } ,
255
+ {
256
+ object : 'self' ,
257
+ property : 'isNaN' ,
258
+ message : 'Please use Number.isNaN instead' ,
259
+ } ,
260
+ {
261
+ object : 'window' ,
262
+ property : 'isNaN' ,
263
+ message : 'Please use Number.isNaN instead' ,
264
+ } ,
265
+ {
266
+ property : '__defineGetter__' ,
267
+ message : 'Please use Object.defineProperty instead.' ,
268
+ } ,
269
+ {
270
+ property : '__defineSetter__' ,
271
+ message : 'Please use Object.defineProperty instead.' ,
272
+ } ,
273
+ {
274
+ object : 'Math' ,
275
+ property : 'pow' ,
276
+ message : 'Use the exponentiation operator (**) instead.' ,
277
+ } ,
278
+ ] ,
253
279
254
280
// disallow use of assignment in return statement
255
281
'no-return-assign' : [ 'error' , 'always' ] ,
@@ -262,9 +288,12 @@ module.exports = {
262
288
263
289
// disallow self assignment
264
290
// https://eslint.org/docs/rules/no-self-assign
265
- 'no-self-assign' : [ 'error' , {
266
- props : true ,
267
- } ] ,
291
+ 'no-self-assign' : [
292
+ 'error' ,
293
+ {
294
+ props : true ,
295
+ } ,
296
+ ] ,
268
297
269
298
// disallow comparisons where both sides are exactly the same
270
299
'no-self-compare' : 'error' ,
@@ -280,11 +309,14 @@ module.exports = {
280
309
'no-unmodified-loop-condition' : 'off' ,
281
310
282
311
// disallow usage of expressions in statement position
283
- 'no-unused-expressions' : [ 'error' , {
284
- allowShortCircuit : false ,
285
- allowTernary : false ,
286
- allowTaggedTemplates : false ,
287
- } ] ,
312
+ 'no-unused-expressions' : [
313
+ 'error' ,
314
+ {
315
+ allowShortCircuit : false ,
316
+ allowTernary : false ,
317
+ allowTaggedTemplates : false ,
318
+ } ,
319
+ ] ,
288
320
289
321
// disallow unused labels
290
322
// https://eslint.org/docs/rules/no-unused-labels
@@ -350,6 +382,6 @@ module.exports = {
350
382
'wrap-iife' : [ 'error' , 'outside' , { functionPrototypeMethods : false } ] ,
351
383
352
384
// require or disallow Yoda conditions
353
- yoda : 'error'
354
- }
385
+ yoda : 'error' ,
386
+ } ,
355
387
} ;
0 commit comments