-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
142 lines (142 loc) · 4.55 KB
/
.eslintrc.cjs
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
module.exports = {
root: true,
env: {
browser: true,
node: true,
es6: true,
jest: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: {
jsx: true,
impliedStrict: true,
},
ecmaVersion: 2020,
sourceType: 'module',
},
settings: {
react: {
version: 'detect',
},
},
globals: {
Atomics: 'readonly',
SharedArrayBuffer: 'readonly',
},
plugins: ['react', 'react-hooks', 'import', '@typescript-eslint'],
// ESLint extends configurations recursively
extends: [
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
],
//to override extends' config, 0-off,1-warn,2-error
rules: {
'no-param-reassign': 1,
'no-invalid-this': 0,
'no-unused-vars': 0,
'no-var': 1,
'no-empty': 1,
'no-return-assign': 1,
'no-inner-declarations': 1,
'no-promise-executor-return': 0,
'no-eq-null': 1,
'no-sparse-arrays': 1,
'no-implicit-coercion': 1,
'no-useless-concat': 0,
'no-labels': 1,
'no-cond-assign': 1,
'no-constant-condition': 1,
'no-prototype-builtins': 1,
'no-case-declarations': 1,
'no-dupe-keys': 1,
'no-redeclare': 1,
'no-unreachable': 1,
'no-useless-escape': 1,
'no-multi-assign': 1,
'no-self-assign': 1,
eqeqeq: 1,
'one-var': [2, 'never'],
'guard-for-in': 1,
'getter-return': 1,
complexity: 0,
'prefer-const': 1,
'prefer-spread': 1,
'prefer-rest-params': 1,
'prefer-object-spread': 0,
'prefer-arrow-callback': 0,
'prefer-promise-reject-errors': 1,
'prefer-object-has-own': 1,
'prefer-regex-literals': 0,
radix: 1,
'max-nested-callbacks': 1,
'max-params': ['warn', 5],
'max-depth': ['warn', 5],
'accessor-pairs': 0,
'import/order': 0,
'import/no-duplicates': ['warn', { 'prefer-inline': true }],
'import/no-unresolved': 'off',
'@typescript-eslint/no-explicit-any': 0,
'@typescript-eslint/no-unused-vars': 0,
'@typescript-eslint/no-empty-interface': 0,
'@typescript-eslint/no-empty-function': 0,
'@typescript-eslint/no-non-null-assertion': 0,
'@typescript-eslint/no-invalid-this': 0,
'@typescript-eslint/no-var-requires': 1,
'@typescript-eslint/no-require-imports': 1,
'@typescript-eslint/no-invalid-void-type': 1,
'@typescript-eslint/no-this-alias': 1,
'@typescript-eslint/no-unused-expressions': 1,
'@typescript-eslint/no-inferrable-types': 0,
'@typescript-eslint/no-namespace': 1,
'@typescript-eslint/no-non-null-asserted-optional-chain': 1,
'@typescript-eslint/no-unnecessary-type-constraint': 1,
// '@typescript-eslint/no-floating-promises': 2,
// '@typescript-eslint/no-misused-promises': 2,
// '@typescript-eslint/await-thenable': 2,
'@typescript-eslint/parameter-properties': 1,
'@typescript-eslint/ban-types': 1,
'@typescript-eslint/ban-ts-comment': 1,
'@typescript-eslint/prefer-for-of': 0,
'@typescript-eslint/prefer-optional-chain': 0,
'@typescript-eslint/prefer-function-type': 0,
'@typescript-eslint/consistent-type-assertions': 0,
'@typescript-eslint/consistent-type-imports': [
'warn',
{ prefer: 'type-imports', fixStyle: 'inline-type-imports' },
],
'@typescript-eslint/no-import-type-side-effects': 'warn',
// By default the rule will use the prefer-inline
'import/consistent-type-specifier-style': ['off'],
'@typescript-eslint/method-signature-style': 0,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-member-accessibility': 0,
'@typescript-eslint/member-ordering': 0,
'@typescript-eslint/consistent-type-definitions': 0,
'@typescript-eslint/class-literal-property-style': 0,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/triple-slash-reference': 1,
'react/no-find-dom-node': 1,
'react/no-deprecated': 1,
'react/no-did-update-set-state': 1,
'react/no-unescaped-entities': 1,
'react/no-unknown-property': 1,
'react/jsx-no-constructed-context-values': 1,
'react/prop-types': 0,
'react/display-name': 0,
'react/prefer-es6-class': 0,
'react/sort-comp': 0,
'react/react-in-jsx-scope': 0,
'react/jsx-no-useless-fragment': 1,
'react/jsx-key': 1,
'react/jsx-uses-react': 0,
'react/jsx-fragments': 0,
'react/jsx-curly-brace-presence': 1,
'react-hooks/rules-of-hooks': 2,
'react-hooks/exhaustive-deps': 1,
'react/self-closing-comp': 1,
'react/no-children-prop': 1,
},
};