Commit 184cbb0
Fix ReqBase<TData>['error'] type (#334)
* Fix ReqBase<TData>['error'] type
It is currently marked as always having a value. But this is not true, its value is `undefined` when the request is either loading or successful.
This means that checking whether the `error` property has a value will trigger `@typescript-eslint/strict-boolean-expressions`
ESLint rule doc: https://github.com/typescript-eslint/typescript-eslint/blob/master/packages/eslint-plugin/docs/rules/strict-boolean-expressions.md
Example playground: https://www.typescriptlang.org/play?#code/JYWwDg9gTgLgBAVwM4FMBiKYGMAWcBmUEIcA5MigLQ4wxikBQDWEAdkvAN5wA2EAhgBNgrAOYAaOCihEokwfxj84AXzgBeRKgzYcAClI06SAFwB6MygAe-cDxQA6FiDP8wwUpM4rJAbQC6AJRMwPhwetKygXCcDHDxcCzsEPYOfKIGACo4KHAwAJ5gKEhwSPz5eTjAJUnCMMBscADuwDw8cPw8TeUlAEa5MFAIKKTBKgxAA
* Fix ArrayDestructure types in useMutation and useQuery.
* Update tests.
Co-authored-by: Zebulan Stanphill <zebulanstanphill@protonmail.com>1 parent 7d33349 commit 184cbb0
File tree
4 files changed
+8
-8
lines changed- src
- __tests__
4 files changed
+8
-8
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
168 | 168 | | |
169 | 169 | | |
170 | 170 | | |
171 | | - | |
| 171 | + | |
172 | 172 | | |
173 | 173 | | |
174 | 174 | | |
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
| 356 | + | |
| 357 | + | |
358 | 358 | | |
359 | 359 | | |
360 | 360 | | |
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
389 | | - | |
390 | | - | |
| 389 | + | |
| 390 | + | |
391 | 391 | | |
392 | 392 | | |
393 | 393 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
0 commit comments