-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
151 lines (150 loc) · 4.95 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
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
143
144
145
146
147
148
149
150
151
const namingOptions = [
{
selector: 'default',
format: ['camelCase'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'variable',
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
leadingUnderscore: 'allow',
trailingUnderscore: 'allow',
},
{
selector: 'typeLike',
format: ['PascalCase'],
},
{
selector: 'function',
format: ['camelCase', 'PascalCase'],
},
{
selector: 'property',
format: ['camelCase', 'UPPER_CASE'],
},
{
selector: 'parameter',
format: ['camelCase', 'PascalCase'],
leadingUnderscore: 'allow',
},
{
selector: 'enumMember',
format: ['UPPER_CASE'],
},
];
module.exports = {
root: true,
extends: ['react-app', 'eslint:recommended', 'plugin:jsx-a11y/recommended'],
plugins: ['prettier', 'jsx-a11y'],
parser: `@typescript-eslint/parser`,
parserOptions: {
project: `./tsconfig.json`,
},
env: {
browser: true,
node: true,
},
settings: {
react: {
version: 'detect',
},
},
rules: {
'@typescript-eslint/array-type': 1,
'@typescript-eslint/ban-types': 1,
'@typescript-eslint/class-literal-property-style': 1,
'@typescript-eslint/consistent-type-assertions': 1,
'@typescript-eslint/consistent-type-definitions': 1,
'@typescript-eslint/consistent-type-imports': 1,
'@typescript-eslint/explicit-function-return-type': 0,
'@typescript-eslint/explicit-member-accessibility': 1,
'@typescript-eslint/explicit-module-boundary-types': 0,
'@typescript-eslint/member-delimiter-style': 1,
'@typescript-eslint/member-ordering': 1,
'@typescript-eslint/method-signature-style': 1,
'@typescript-eslint/naming-convention': [1, ...namingOptions],
'@typescript-eslint/no-confusing-non-null-assertion': 1,
'@typescript-eslint/no-dynamic-delete': 1,
'@typescript-eslint/no-empty-interface': 1,
'@typescript-eslint/no-explicit-any': 1,
'@typescript-eslint/no-extra-non-null-assertion': 1,
'@typescript-eslint/no-extraneous-class': 1,
'@typescript-eslint/no-floating-promises': 1,
'@typescript-eslint/no-for-in-array': 1,
'@typescript-eslint/no-implicit-any-catch': 1,
'@typescript-eslint/no-implied-eval': 1,
'@typescript-eslint/no-inferrable-types': 1,
'@typescript-eslint/no-invalid-void-type': 1,
'@typescript-eslint/no-misused-new': 1,
'@typescript-eslint/no-misused-promises': 1,
'@typescript-eslint/no-namespace': 1,
'@typescript-eslint/no-non-null-asserted-optional-chain': 1,
'@typescript-eslint/no-non-null-assertion': 1,
'@typescript-eslint/no-parameter-properties': 1,
'@typescript-eslint/no-require-imports': 1,
'@typescript-eslint/no-this-alias': 1,
'@typescript-eslint/no-throw-literal': 1,
'@typescript-eslint/no-type-alias': 0,
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 1,
'@typescript-eslint/no-unnecessary-condition': 0,
'@typescript-eslint/no-unnecessary-qualifier': 1,
'@typescript-eslint/no-unnecessary-type-arguments': 1,
'@typescript-eslint/no-unnecessary-type-assertion': 1,
'@typescript-eslint/no-unsafe-assignment': 1,
'@typescript-eslint/no-unsafe-call': 1,
'@typescript-eslint/no-unsafe-member-access': 1,
'@typescript-eslint/no-unsafe-return': 1,
'@typescript-eslint/no-var-requires': 1,
'@typescript-eslint/prefer-as-const': 1,
'@typescript-eslint/prefer-enum-initializers': 1,
'@typescript-eslint/prefer-for-of': 1,
'@typescript-eslint/prefer-function-type': 1,
'@typescript-eslint/prefer-includes': 1,
'@typescript-eslint/prefer-literal-enum-member': 1,
'@typescript-eslint/prefer-namespace-keyword': 1,
'@typescript-eslint/prefer-nullish-coalescing': 1,
'@typescript-eslint/prefer-optional-chain': 1,
'@typescript-eslint/prefer-readonly': 1,
'@typescript-eslint/prefer-readonly-parameter-types': 0,
'@typescript-eslint/prefer-reduce-type-parameter': 1,
'@typescript-eslint/prefer-regexp-exec': 1,
'@typescript-eslint/prefer-string-starts-ends-with': 1,
'@typescript-eslint/prefer-ts-expect-error': 1,
'@typescript-eslint/promise-function-async': 1,
'@typescript-eslint/require-array-sort-compare': 1,
'@typescript-eslint/restrict-plus-operands': 0,
'@typescript-eslint/restrict-template-expressions': 1,
'@typescript-eslint/strict-boolean-expressions': 0,
'@typescript-eslint/switch-exhaustiveness-check': 1,
'@typescript-eslint/triple-slash-reference': 1,
'@typescript-eslint/type-annotation-spacing': 1,
'@typescript-eslint/prefer-nullish-coalescing': 0,
'@typescript-eslint/typedef': 0,
'@typescript-eslint/unbound-method': 1,
'@typescript-eslint/unified-signatures': 1,
'@typescript-eslint/no-invalid-void-type': 0,
'import/order': 0,
'no-mixed-spaces-and-tabs': ['warn', 'smart-tabs'],
'prettier/prettier': 'error',
'react/display-name': 0,
'react/prop-types': 0,
'jsx-a11y/anchor-is-valid': 0,
'react/style-prop-object': [
'error',
{
allow: [
'FormattedNumber',
'FormattedDateParts',
'FormattedRelativeTime',
],
},
],
'react-hooks/exhaustive-deps': [
'warn',
{
additionalHooks: '(useExec|useSubmit)',
},
],
},
};