Skip to content

Commit 8ff3898

Browse files
committed
comment obsolete rules
1 parent df5e340 commit 8ff3898

File tree

1 file changed

+102
-94
lines changed

1 file changed

+102
-94
lines changed

.eslintrc.js

Lines changed: 102 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,11 @@ module.exports = {
9292
'sonarjs/prefer-immediate-return': 'error',
9393
'sonarjs/no-small-switch': 'error',
9494
'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',
95100
},
96101
parserOptions: {
97102
project: path.join(__dirname, 'redisinsight/api/tsconfig.json'),
@@ -186,6 +191,11 @@ module.exports = {
186191
'sonarjs/no-identical-functions': [0, 5],
187192
'sonarjs/prefer-immediate-return': 'error',
188193
'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',
189199
'import/order': [
190200
1,
191201
{
@@ -250,147 +260,145 @@ module.exports = {
250260
rules: {
251261
semi: 'off',
252262
'@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
256263
'@typescript-eslint/no-unused-vars': 'off',
257264
'@typescript-eslint/no-use-before-define': 'off',
258265
'@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',
262266
'sonarjs/no-identical-functions': 'off',
263267
'sonarjs/prefer-immediate-return': 'off',
264268
'sonarjs/no-duplicate-string': 'off',
265269
'sonarjs/cognitive-complexity': 'off',
266270
'sonarjs/no-small-switch': 'off',
267271
'max-len': 'off',
268-
'prefer-destructuring': 'off',
269-
'prefer-arrow-callback': 'off',
270-
'no-unneeded-ternary': 'off',
271272
'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',
284273
'no-underscore-dangle': 'off',
285274
'import/no-duplicates': 'off',
286275
'no-console': 'off',
287276
'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',
288296
},
289297
},
290298
// Temporary (maybe) disable some rules for API tests
291299
{
292300
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
293304
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',
304308
'prefer-template': 'off',
305-
radix: 'off',
306309
'import/order': 'off',
307-
'arrow-body-style': 'off',
308-
'no-constant-condition': 'off',
309310
'@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',
318311
'@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',
324312
'@typescript-eslint/no-shadow': 'off',
325-
'import/first': 'off',
326313
'@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',
334314
'@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',
347360
},
348361
},
349362
// Temporary disable some rules for UI
350363
{
351364
files: ['redisinsight/ui/**/*.ts*'],
352365
rules: {
353-
'react/jsx-boolean-value': 'off',
354-
'sonarjs/no-nested-template-literals': 'off',
355366
'sonarjs/cognitive-complexity': 'off',
356-
'sonarjs/no-extra-arguments': 'off',
357-
'consistent-return': 'off',
358367
'@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',
362368
'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',
368369
'react/prop-types': 'off',
369-
'no-useless-escape': 'off',
370-
'no-template-curly-in-string': 'off',
370+
'import/order': 'off',
371+
'prefer-const': 'off',
371372
'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',
372387
},
373388
},
374389
// Temporary disable some rules for UI packages
375390
{
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
376394
files: ['redisinsight/ui/src/packages/**/*.ts*'],
377395
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',
385397
'react/prop-types': 'off',
386-
eqeqeq: 'off',
398+
'react-hooks/rules-of-hooks': 'off',
399+
'sonarjs/cognitive-complexity': 'off',
387400
'max-len': 'off',
388-
'no-constant-condition': 'off',
389401
'@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',
394402
'prefer-destructuring': 'off',
395403
},
396404
},

0 commit comments

Comments
 (0)