-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.yml
225 lines (186 loc) · 5.16 KB
/
.eslintrc.yml
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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
---
root: true
extends:
- "react-app"
- "plugin:react/recommended"
- "plugin:@typescript-eslint/eslint-recommended"
- "plugin:@typescript-eslint/recommended"
- "plugin:@typescript-eslint/recommended-requiring-type-checking"
- 'eslint-config-airbnb-base'
plugins:
- "@typescript-eslint"
- react
- babel
- react-hooks
ignorePatterns:
- "*.js"
parser: "@typescript-eslint/parser"
parserOptions:
ecmaVersion: 2018
sourceType: module
project: "./tsconfig.json"
ecmaFeatures:
jsx: true
warnOnUnsupportedTypeScriptVersion: true
rules:
react-hooks/rules-of-hooks: error
react-hooks/exhaustive-deps: error
implicit-arrow-linebreak: 0
react/self-closing-comp: error
react/jsx-closing-tag-location: error
react/jsx-tag-spacing: error
react/jsx-closing-bracket-location: error
react/jsx-wrap-multilines: error
react/jsx-max-props-per-line:
- error
- maximum: 1
when: multiline
react/jsx-first-prop-new-line: error
arrow-parens:
- error
- "as-needed"
no-void: 0
no-plusplus: 0
radix: 0
no-bitwise: 0
brace-style:
- error
- stroustrup
no-param-reassign:
- error
- props: false
no-console:
- error
- allow:
- error
array-bracket-spacing:
- error
- always
comma-dangle:
- error
- arrays: 'always'
objects: 'always'
imports: 'always'
exports: 'always'
functions: 'never'
"@typescript-eslint/array-type":
- error
- default: "array-simple"
default-case: "off"
no-dupe-class-members: "off"
no-undef: "off"
"@typescript-eslint/consistent-type-assertions": warn
"@typescript-eslint/class-literal-property-style":
- warn
- fields
"@typescript-eslint/consistent-type-definitions":
- off
- type
"@typescript-eslint/explicit-member-accessibility":
- error
- accessibility: "no-public"
indent: 0
"@typescript-eslint/indent":
- error
- 2
"func-call-spacing": 0
"@typescript-eslint/func-call-spacing":
- error
"keyword-spacing": 0
"@typescript-eslint/keyword-spacing":
- error
"comma-spacing": "off"
"@typescript-eslint/comma-spacing":
- error
"@typescript-eslint/no-extraneous-class":
- error
- allowStaticOnly: true
"@typescript-eslint/explicit-function-return-type": off
"@typescript-eslint/explicit-module-boundary-types": off
# TODO: Turn this back on in next commit
"@typescript-eslint/no-explicit-any": off
# TS will handle this on its own
"import/no-unresolved": off
"import/extensions": off
# TS will yell if no prop type is provided
"react/prop-types": off
"no-mixed-operators": 0
# TS will catch
"consistent-return": 0
"import/prefer-default-export": 0
"@typescript-eslint/member-delimiter-style":
- error
"@typescript-eslint/naming-convention":
- error
# Type definitions should always be PascalCase
- selector: typeLike
format:
- StrictPascalCase
leadingUnderscore: allow
trailingUnderscore: forbid
# Names of normal variables must be camelCase or SNAKE_CASE, no underscore
- selector: variableLike
leadingUnderscore: forbid
trailingUnderscore: forbid
filter:
match: false
regex: _id|_
format: null
- selector: memberLike
leadingUnderscore: forbid
trailingUnderscore: forbid
filter:
match: false
regex: _id
format: null
- selector: typeParameter
format:
- StrictPascalCase
no-array-constructor: "off"
"@typescript-eslint/no-array-constructor": error
"@typescript-eslint/no-dynamic-delete": error
"@typescript-eslint/no-extra-non-null-assertion": error
"@typescript-eslint/no-floating-promises":
- error
- ignoreVoid: true
ignoreIIFE: true
"@typescript-eslint/no-non-null-asserted-optional-chain": error
"@typescript-eslint/no-non-null-assertion": off
"@typescript-eslint/no-unnecessary-qualifier": error
"@typescript-eslint/no-unnecessary-type-arguments": error
"@typescript-eslint/no-unsafe-assignment": off
"@typescript-eslint/no-unsafe-member-access": off
"@typescript-eslint/no-unsafe-return": off
"@typescript-eslint/prefer-includes": error
"@typescript-eslint/prefer-nullish-coalescing": error
"@typescript-eslint/prefer-optional-chain": error
"@typescript-eslint/prefer-readonly": error
"@typescript-eslint/prefer-reduce-type-parameter": error
"@typescript-eslint/restrict-plus-operands": error
"semi": 0
"@typescript-eslint/semi": error
"@typescript-eslint/switch-exhaustiveness-check": error
"@typescript-eslint/unbound-method":
- error
- ignoreStatic: true
no-use-before-define: "off"
no-nested-ternary: 0
"@typescript-eslint/no-use-before-define":
- warn
- functions: false
classes: false
variables: false
typedefs: false
no-unused-expressions: "off"
"@typescript-eslint/no-unused-expressions":
- error
- allowShortCircuit: true
allowTernary: true
allowTaggedTemplates: true
no-unused-vars: "off"
"@typescript-eslint/no-unused-vars":
- warn
- args: none
ignoreRestSiblings: true
no-useless-constructor: "off"
"@typescript-eslint/no-useless-constructor": warn