-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
108 lines (106 loc) · 3.57 KB
/
.eslintrc.js
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
module.exports = {
env: {
browser: true,
es2021: true
},
extends: ['plugin:react/recommended', 'standard-with-typescript', 'airbnb-typescript', 'plugin:sonarjs/recommended', 'react-app'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true
},
ecmaVersion: 12,
sourceType: 'module',
project: 'tsconfig.json'
},
plugins: ['react', '@typescript-eslint', 'sonarjs'],
rules: {
'import/no-cycle': 'off',
'no-use-before-define': 'off',
'import/prefer-default-export': 'off',
'for-direction': 'error',
'no-prototype-builtins': 'error',
'no-template-curly-in-string': 'error',
'no-unsafe-negation': 'error',
'array-callback-return': 'error',
'block-scoped-var': 'error',
complexity: ['error', { max: 9 }],
'consistent-return': 'error',
eqeqeq: ['error', 'smart'],
'guard-for-in': 'error',
'no-alert': 'error',
'no-caller': 'error',
'no-div-regex': 'error',
'no-eval': 'error',
'no-extend-native': 'error',
'no-extra-bind': 'error',
'no-extra-label': 'error',
'no-floating-decimal': 'error',
'no-implied-eval': 'error',
'no-iterator': 'error',
'no-labels': 'error',
'no-lone-blocks': 'error',
'no-loop-func': 'error',
'no-new': 'error',
'no-new-func': 'error',
'no-new-wrappers': 'error',
'no-proto': 'error',
'no-restricted-properties': 'error',
'no-return-assign': 'error',
'no-return-await': 'error',
'no-self-compare': 'error',
'no-sequences': 'error',
'no-throw-literal': 'error',
'no-unmodified-loop-condition': 'error',
'no-unused-expressions': 'error',
'no-useless-call': 'error',
'no-useless-concat': 'error',
'no-useless-escape': 'error',
'no-useless-return': 'error',
'no-void': 'error',
'no-with': 'error',
radix: 'error',
'wrap-iife': 'error',
yoda: 'error',
camelcase: 'warn',
// @typescript-eslint Rules
'@typescript-eslint/semi': 'off',
'@typescript-eslint/no-use-before-define': [
'error'
],
// SonarJS Rules
'sonarjs/no-identical-conditions': 'error',
'sonarjs/cognitive-complexity': ['error', 5],
'sonarjs/max-switch-cases': ['error', 3],
'sonarjs/elseif-without-else': 'error',
'sonarjs/no-all-duplicated-branches': 'error',
'sonarjs/no-collapsible-if': 'error',
'sonarjs/no-collection-size-mischeck': 'error',
'sonarjs/no-duplicate-string': ['error', 2],
'sonarjs/no-duplicated-branches': 'error',
'sonarjs/no-element-overwrite': 'error',
'sonarjs/no-empty-collection': 'error',
'sonarjs/no-extra-arguments': 'error',
'sonarjs/no-gratuitous-expressions': 'error',
'sonarjs/no-identical-conditions': 'error',
'sonarjs/no-identical-expressions': 'error',
'sonarjs/no-identical-functions': ['error', 3],
'sonarjs/no-ignored-return': 'error',
'sonarjs/no-inverted-boolean-check': 'error',
'sonarjs/no-nested-switch': 'error',
'sonarjs/no-nested-template-literals': 'error',
'sonarjs/no-one-iteration-loop': 'error',
'sonarjs/no-redundant-boolean': 'error',
'sonarjs/no-redundant-jump': 'error',
'sonarjs/no-same-line-conditional': 'error',
'sonarjs/no-small-switch': 'error',
'sonarjs/no-unused-collection': 'error',
'sonarjs/no-use-of-empty-return-value': 'error',
'sonarjs/no-useless-catch': 'error',
'sonarjs/non-existent-operator': 'error',
'sonarjs/prefer-immediate-return': 'error',
'sonarjs/prefer-object-literal': 'error',
'sonarjs/prefer-single-boolean-return': 'error',
'sonarjs/prefer-while': 'error',
}
}