@@ -92,6 +92,11 @@ module.exports = {
92
92
'sonarjs/prefer-immediate-return' : 'error' ,
93
93
'sonarjs/no-small-switch' : 'error' ,
94
94
'no-console' : 'error' ,
95
+ 'import/no-duplicates' : 'error' ,
96
+ 'prefer-destructuring' : 'error' ,
97
+ 'no-unneeded-ternary' : 'error' ,
98
+ 'prefer-template' : 'error' ,
99
+ 'prefer-const' : 'error' ,
95
100
} ,
96
101
parserOptions : {
97
102
project : path . join ( __dirname , 'redisinsight/api/tsconfig.json' ) ,
@@ -186,6 +191,11 @@ module.exports = {
186
191
'sonarjs/no-identical-functions' : [ 0 , 5 ] ,
187
192
'sonarjs/prefer-immediate-return' : 'error' ,
188
193
'sonarjs/no-small-switch' : 'error' ,
194
+ 'import/no-duplicates' : 'error' ,
195
+ 'prefer-destructuring' : 'error' ,
196
+ 'no-unneeded-ternary' : 'error' ,
197
+ 'prefer-template' : 'error' ,
198
+ 'prefer-const' : 'error' ,
189
199
'import/order' : [
190
200
1 ,
191
201
{
@@ -250,147 +260,145 @@ module.exports = {
250
260
rules : {
251
261
semi : 'off' ,
252
262
'@typescript-eslint/semi' : 'off' ,
253
- // NestJS module files - more lenient with unused vars due to decorator usage
254
- // TODO: Probably fixable after update of deps
255
- // https://github.com/nestjs/nest-cli/issues/1750
256
263
'@typescript-eslint/no-unused-vars' : 'off' ,
257
264
'@typescript-eslint/no-use-before-define' : 'off' ,
258
265
'@typescript-eslint/no-unused-expressions' : 'off' ,
259
- '@typescript-eslint/naming-convention' : 'off' ,
260
- '@typescript-eslint/lines-between-class-members' : 'off' ,
261
- '@typescript-eslint/no-shadow' : 'off' ,
262
266
'sonarjs/no-identical-functions' : 'off' ,
263
267
'sonarjs/prefer-immediate-return' : 'off' ,
264
268
'sonarjs/no-duplicate-string' : 'off' ,
265
269
'sonarjs/cognitive-complexity' : 'off' ,
266
270
'sonarjs/no-small-switch' : 'off' ,
267
271
'max-len' : 'off' ,
268
- 'prefer-destructuring' : 'off' ,
269
- 'prefer-arrow-callback' : 'off' ,
270
- 'no-unneeded-ternary' : 'off' ,
271
272
'import/order' : 'off' ,
272
- 'no-restricted-syntax' : 'off' ,
273
- 'no-control-regex' : 'off' ,
274
- 'func-names' : 'off' ,
275
- 'prefer-template' : 'off' ,
276
- 'no-case-declarations' : 'off' ,
277
- radix : 'off' ,
278
- 'arrow-body-style' : 'off' ,
279
- 'no-constant-condition' : 'off' ,
280
- 'consistent-return' : 'off' ,
281
- 'prefer-const' : 'off' ,
282
- 'no-useless-concat' : 'off' ,
283
- 'import/export' : 'off' ,
284
273
'no-underscore-dangle' : 'off' ,
285
274
'import/no-duplicates' : 'off' ,
286
275
'no-console' : 'off' ,
287
276
'prettier/prettier' : 'off' ,
277
+ 'prefer-destructuring' : 'off' ,
278
+ 'no-unneeded-ternary' : 'off' ,
279
+ 'prefer-template' : 'off' ,
280
+ 'prefer-const' : 'off' ,
281
+ '@typescript-eslint/naming-convention' : 'off' ,
282
+ '@typescript-eslint/lines-between-class-members' : 'off' ,
283
+ '@typescript-eslint/no-shadow' : 'off' ,
284
+ // REDUNDANT: These are OFF by default in newer Airbnb config
285
+ // 'prefer-arrow-callback': 'off',
286
+ // 'no-restricted-syntax': 'off',
287
+ // 'no-control-regex': 'off',
288
+ // 'func-names': 'off',
289
+ // 'no-case-declarations': 'off',
290
+ // radix: 'off',
291
+ // 'arrow-body-style': 'off',
292
+ // 'no-constant-condition': 'off',
293
+ // 'consistent-return': 'off',
294
+ // 'no-useless-concat': 'off',
295
+ // 'import/export': 'off',
288
296
} ,
289
297
} ,
290
298
// Temporary (maybe) disable some rules for API tests
291
299
{
292
300
files : [ 'redisinsight/api/test/**/*.ts' ] ,
301
+ // In order to lint just the test files
302
+ // make sure there's no override on 'redisinsight/api'
303
+ // a.k.a. comment the above section
293
304
rules : {
294
- 'sonarjs/no-duplicate-string' : 'off' ,
295
- 'sonarjs/no-ignored-return' : 'off' ,
296
- 'sonarjs/cognitive-complexity' : 'off' ,
297
- 'sonarjs/prefer-immediate-return' : 'off' ,
298
- 'sonarjs/no-identical-expressions' : 'off' ,
299
- 'sonarjs/no-nested-switch' : 'off' ,
300
- 'max-len' : 'off' ,
301
- 'sonarjs/no-identical-functions' : 'off' ,
302
- 'prefer-destructuring' : 'off' ,
303
- 'prefer-arrow-callback' : 'off' ,
305
+ '@typescript-eslint/no-loop-func' : 'off' ,
306
+ '@typescript-eslint/semi' : 'off' ,
307
+ 'no-console' : 'off' ,
304
308
'prefer-template' : 'off' ,
305
- radix : 'off' ,
306
309
'import/order' : 'off' ,
307
- 'arrow-body-style' : 'off' ,
308
- 'no-constant-condition' : 'off' ,
309
310
'@typescript-eslint/no-use-before-define' : 'off' ,
310
- 'no-plusplus' : 'off' ,
311
- 'no-restricted-syntax' : 'off' ,
312
- 'prefer-const' : 'off' ,
313
- 'no-case-declarations' : 'off' ,
314
- 'array-callback-return' : 'off' ,
315
- 'no-underscore-dangle' : 'off' ,
316
- '@typescript-eslint/semi' : 'off' ,
317
- semi : 'off' ,
318
311
'@typescript-eslint/no-unused-vars' : 'off' ,
319
- 'import/newline-after-import' : 'off' ,
320
- 'func-names' : 'off' ,
321
- 'global-require' : 'off' ,
322
- 'object-shorthand' : 'off' ,
323
- 'import/no-useless-path-segments' : 'off' ,
324
312
'@typescript-eslint/no-shadow' : 'off' ,
325
- 'import/first' : 'off' ,
326
313
'@typescript-eslint/no-unused-expressions' : 'off' ,
327
- 'one-var' : 'off' ,
328
- 'no-multi-assign' : 'off' ,
329
- 'spaced-comment' : 'off' ,
330
- 'no-console' : 'off' ,
331
- 'no-lonely-if' : 'off' ,
332
- 'no-useless-computed-key' : 'off' ,
333
- '@typescript-eslint/no-loop-func' : 'off' ,
334
314
'@typescript-eslint/naming-convention' : 'off' ,
335
- 'no-return-assign' : 'off' ,
336
- 'consistent-return' : 'off' ,
337
- 'prefer-promise-reject-errors' : 'off' ,
338
- 'no-fallthrough' : 'off' ,
339
- 'no-else-return' : 'off' ,
340
- 'no-empty' : 'off' ,
341
- 'import/no-mutable-exports' : 'off' ,
342
- 'import/no-cycle' : 'off' ,
343
- 'no-useless-escape' : 'off' ,
344
- 'default-case' : 'off' ,
345
- eqeqeq : 'off' ,
346
- yoda : 'off' ,
315
+ 'sonarjs/no-duplicate-string' : 'off' ,
316
+ 'sonarjs/prefer-immediate-return' : 'off' ,
317
+ 'sonarjs/cognitive-complexity' : 'off' ,
318
+ 'prettier/prettier' : 'off' ,
319
+ 'max-len' : 'off' ,
320
+ 'prefer-destructuring' : 'off' ,
321
+ 'prefer-const' : 'off' ,
322
+ // REDUNDANT: These are OFF by default in newer Airbnb config
323
+ // semi: 'off',
324
+ // 'sonarjs/no-ignored-return': 'off',
325
+ // 'sonarjs/no-identical-expressions': 'off',
326
+ // 'sonarjs/no-nested-switch': 'off',
327
+ // 'sonarjs/no-identical-functions': 'off',
328
+ // 'no-plusplus': 'off',
329
+ // 'array-callback-return': 'off',
330
+ // 'no-underscore-dangle': 'off',
331
+ // 'import/newline-after-import': 'off',
332
+ // 'global-require': 'off',
333
+ // 'object-shorthand': 'off',
334
+ // 'import/no-useless-path-segments': 'off',
335
+ // 'import/first': 'off',
336
+ // 'one-var': 'off',
337
+ // 'no-multi-assign': 'off',
338
+ // 'spaced-comment': 'off',
339
+ // 'no-lonely-if': 'off',
340
+ // 'no-useless-computed-key': 'off',
341
+ // 'no-return-assign': 'off',
342
+ // 'prefer-promise-reject-errors': 'off',
343
+ // 'no-fallthrough': 'off',
344
+ // 'no-else-return': 'off',
345
+ // 'no-empty': 'off',
346
+ // 'import/no-mutable-exports': 'off',
347
+ // 'import/no-cycle': 'off',
348
+ // 'no-useless-escape': 'off',
349
+ // 'default-case': 'off',
350
+ // eqeqeq: 'off',
351
+ // yoda: 'off',
352
+ // 'prefer-arrow-callback': 'off',
353
+ // 'arrow-body-style': 'off',
354
+ // 'no-constant-condition': 'off',
355
+ // 'no-restricted-syntax': 'off',
356
+ // 'no-case-declarations': 'off',
357
+ // 'func-names': 'off',
358
+ // 'consistent-return': 'off',
359
+ // radix: 'off',
347
360
} ,
348
361
} ,
349
362
// Temporary disable some rules for UI
350
363
{
351
364
files : [ 'redisinsight/ui/**/*.ts*' ] ,
352
365
rules : {
353
- 'react/jsx-boolean-value' : 'off' ,
354
- 'sonarjs/no-nested-template-literals' : 'off' ,
355
366
'sonarjs/cognitive-complexity' : 'off' ,
356
- 'sonarjs/no-extra-arguments' : 'off' ,
357
- 'consistent-return' : 'off' ,
358
367
'@typescript-eslint/no-unused-vars' : 'off' ,
359
- 'react/no-array-index-key' : 'off' ,
360
- 'react/no-unused-prop-types' : 'off' ,
361
- 'react/destructuring-assignment' : 'off' ,
362
368
'import/extensions' : 'off' ,
363
- 'jsx-a11y/control-has-associated-label' : 'off' ,
364
- 'react/button-has-type' : 'off' ,
365
- 'prefer-const' : 'off' ,
366
- 'react/no-unescaped-entities' : 'off' ,
367
- 'import/order' : 'off' ,
368
369
'react/prop-types' : 'off' ,
369
- 'no-useless-escape ' : 'off' ,
370
- 'no-template-curly-in-string ' : 'off' ,
370
+ 'import/order ' : 'off' ,
371
+ 'prefer-const ' : 'off' ,
371
372
'prettier/prettier' : 'off' ,
373
+ 'prefer-destructuring' : 'off' ,
374
+ // REDUNDANT: These are OFF by default in newer Airbnb config
375
+ // 'react/jsx-boolean-value': 'off',
376
+ // 'sonarjs/no-nested-template-literals': 'off',
377
+ // 'sonarjs/no-extra-arguments': 'off',
378
+ // 'consistent-return': 'off',
379
+ // 'react/no-array-index-key': 'off',
380
+ // 'react/no-unused-prop-types': 'off',
381
+ // 'react/destructuring-assignment': 'off',
382
+ // 'jsx-a11y/control-has-associated-label': 'off',
383
+ // 'react/button-has-type': 'off',
384
+ // 'react/no-unescaped-entities': 'off',
385
+ // 'no-useless-escape': 'off',
386
+ // 'no-template-curly-in-string': 'off',
372
387
} ,
373
388
} ,
374
389
// Temporary disable some rules for UI packages
375
390
{
391
+ // In order to lint just UI packages
392
+ // make sure there's no override on 'redisinsight/ui'
393
+ // a.k.a. comment the above section
376
394
files : [ 'redisinsight/ui/src/packages/**/*.ts*' ] ,
377
395
rules : {
378
- 'react/destructuring-assignment' : 'off' ,
379
- 'react-hooks/rules-of-hooks' : 'off' ,
380
- 'no-restricted-globals' : 'off' ,
381
- 'func-names' : 'off' ,
382
- 'jsx-a11y/click-events-have-key-events' : 'off' ,
383
- 'jsx-a11y/no-static-element-interactions' : 'off' ,
384
- 'react/no-unused-prop-types' : 'off' ,
396
+ 'import/extensions' : 'off' ,
385
397
'react/prop-types' : 'off' ,
386
- eqeqeq : 'off' ,
398
+ 'react-hooks/rules-of-hooks' : 'off' ,
399
+ 'sonarjs/cognitive-complexity' : 'off' ,
387
400
'max-len' : 'off' ,
388
- 'no-constant-condition' : 'off' ,
389
401
'@typescript-eslint/no-unused-vars' : 'off' ,
390
- 'sonarjs/cognitive-complexity' : 'off' ,
391
- 'sonarjs/no-unused-collection' : 'off' ,
392
- 'sonarjs/no-ignored-return' : 'off' ,
393
- 'array-callback-return' : 'off' ,
394
402
'prefer-destructuring' : 'off' ,
395
403
} ,
396
404
} ,
0 commit comments