Skip to content

Commit 1521623

Browse files
committed
Updated to TS 5.0
1 parent 0e07511 commit 1521623

File tree

3 files changed

+23
-25
lines changed

3 files changed

+23
-25
lines changed

package-lock.json

+9-12
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
"cross-fetch": "^3.1.5",
1212
"jsdom": "^21.1.1",
1313
"prettier": "^2.8.7",
14+
"typescript": "^5.0.3",
1415
"vite-tsconfig-paths": "^4.0.7",
1516
"vitest": "^0.29.8"
1617
},

scripts/tests/__snapshots__/all.test.ts.snap

+13-13
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ src/01-generics-intro/03-multiple-generics.problem.ts(20,5): error TS2344: Type
1010
src/01-generics-intro/04-multiple-generics-per-object.problem.ts(23,5): error TS2344: Type 'false' does not satisfy the constraint 'true'.
1111
src/01-generics-intro/05-generics-in-classes.problem.ts(22,12): error TS2344: Type 'false' does not satisfy the constraint 'true'.
1212
src/01-generics-intro/06-generic-mapper.problem.ts(6,5): error TS2698: Spread types may only be created from object types.
13-
src/01-generics-intro/06-generic-mapper.problem.ts(7,18): error TS2571: Object is of type 'unknown'.
14-
src/01-generics-intro/06-generic-mapper.problem.ts(7,36): error TS2571: Object is of type 'unknown'.
13+
src/01-generics-intro/06-generic-mapper.problem.ts(7,18): error TS18046: 'user' is of type 'unknown'.
14+
src/01-generics-intro/06-generic-mapper.problem.ts(7,36): error TS18046: 'user' is of type 'unknown'.
1515
src/01-generics-intro/06-generic-mapper.problem.ts(31,7): error TS2344: Type 'false' does not satisfy the constraint 'true'.
1616
src/01-generics-intro/06-generic-mapper.problem.ts(61,7): error TS2344: Type 'false' does not satisfy the constraint 'true'.
1717
src/01-generics-intro/06-generic-mapper.problem.ts(81,5): error TS2578: Unused '@ts-expect-error' directive.
@@ -20,14 +20,14 @@ src/02-passing-type-arguments/07-create-new-set.problem.ts(8,29): error TS2558:
2020
src/02-passing-type-arguments/07-create-new-set.problem.ts(12,10): error TS2344: Type 'false' does not satisfy the constraint 'true'.
2121
src/02-passing-type-arguments/07-create-new-set.problem.ts(13,10): error TS2344: Type 'false' does not satisfy the constraint 'true'.
2222
src/02-passing-type-arguments/08-default-generics.problem.ts(14,10): error TS2344: Type 'false' does not satisfy the constraint 'true'.
23-
src/02-passing-type-arguments/09-generics-in-type-arguments-in-arguments.problem.ts(15,24): error TS2571: Object is of type 'unknown'.
23+
src/02-passing-type-arguments/09-generics-in-type-arguments-in-arguments.problem.ts(15,24): error TS18046: 'component' is of type 'unknown'.
2424
src/02-passing-type-arguments/09-generics-in-type-arguments-in-arguments.problem.ts(28,12): error TS2344: Type 'false' does not satisfy the constraint 'true'.
2525
src/02-passing-type-arguments/10-reduce.problem.ts(14,3): error TS7053: Element implicitly has an 'any' type because expression of type 'string' can't be used to index type '{}'.
2626
No index signature with a parameter of type 'string' was found on type '{}'.
2727
src/02-passing-type-arguments/10-reduce.problem.ts(28,24): error TS2344: Type 'false' does not satisfy the constraint 'true'.
2828
src/02-passing-type-arguments/11-data-fetcher.problem.ts(10,32): error TS2558: Expected 0 type arguments, but got 1.
2929
src/02-passing-type-arguments/11-data-fetcher.problem.ts(15,24): error TS2344: Type 'false' does not satisfy the constraint 'true'.
30-
src/03-art-of-type-arguments/12-generics-at-different-levels.problem.ts(8,19): error TS2571: Object is of type 'unknown'.
30+
src/03-art-of-type-arguments/12-generics-at-different-levels.problem.ts(8,19): error TS18046: 'config' is of type 'unknown'.
3131
src/03-art-of-type-arguments/12-generics-at-different-levels.problem.ts(41,14): error TS2344: Type 'false' does not satisfy the constraint 'true'.
3232
src/03-art-of-type-arguments/12-generics-at-different-levels.problem.ts(47,7): error TS2698: Spread types may only be created from object types.
3333
src/03-art-of-type-arguments/12-generics-at-different-levels.problem.ts(57,14): error TS2344: Type 'false' does not satisfy the constraint 'true'.
@@ -38,7 +38,7 @@ src/03-art-of-type-arguments/13-typed-object-keys.problem.ts(10,22): error TS276
3838
Argument of type 'unknown' is not assignable to parameter of type 'object'.
3939
src/03-art-of-type-arguments/13-typed-object-keys.problem.ts(21,22): error TS2344: Type 'false' does not satisfy the constraint 'true'.
4040
src/03-art-of-type-arguments/14-safe-function.problem.ts(7,5): error TS2370: A rest parameter must be of an array type.
41-
src/03-art-of-type-arguments/14-safe-function.problem.ts(18,22): error TS2571: Object is of type 'unknown'.
41+
src/03-art-of-type-arguments/14-safe-function.problem.ts(18,22): error TS18046: 'func' is of type 'unknown'.
4242
src/03-art-of-type-arguments/14-safe-function.problem.ts(18,30): error TS2488: Type 'unknown' must have a '[Symbol.iterator]()' method that returns an iterator.
4343
src/03-art-of-type-arguments/14-safe-function.problem.ts(44,7): error TS2344: Type 'false' does not satisfy the constraint 'true'.
4444
src/03-art-of-type-arguments/14-safe-function.problem.ts(76,7): error TS2344: Type 'false' does not satisfy the constraint 'true'.
@@ -49,7 +49,7 @@ src/03-art-of-type-arguments/14.7-string-number-union.problem.ts(14,10): error T
4949
src/03-art-of-type-arguments/14.7-string-number-union.problem.ts(17,1): error TS2578: Unused '@ts-expect-error' directive.
5050
src/03-art-of-type-arguments/14.7-string-number-union.problem.ts(22,1): error TS2578: Unused '@ts-expect-error' directive.
5151
src/03-art-of-type-arguments/15-array-or-array-member-in-generics.problem.ts(10,10): error TS2344: Type 'false' does not satisfy the constraint 'true'.
52-
src/03-art-of-type-arguments/16-class-names-creator.problem.ts(7,24): error TS2571: Object is of type 'unknown'.
52+
src/03-art-of-type-arguments/16-class-names-creator.problem.ts(7,24): error TS18046: 'classes' is of type 'unknown'.
5353
src/03-art-of-type-arguments/16-class-names-creator.problem.ts(34,3): error TS2578: Unused '@ts-expect-error' directive.
5454
src/03-art-of-type-arguments/16-class-names-creator.problem.ts(39,3): error TS2578: Unused '@ts-expect-error' directive.
5555
src/03-art-of-type-arguments/16-class-names-creator.problem.ts(42,3): error TS2578: Unused '@ts-expect-error' directive.
@@ -86,7 +86,7 @@ src/05-function-overloads/23-function-overload-implementation.problem.ts(42,49):
8686
Overload 2 of 2, '(role: \\"user\\"): UserPrivileges', gave the following error.
8787
Argument of type '\\"anonymous\\"' is not assignable to parameter of type '\\"user\\"'.
8888
src/05-function-overloads/23-function-overload-implementation.problem.ts(47,12): error TS2344: Type 'false' does not satisfy the constraint 'true'.
89-
src/05-function-overloads/24-function-overloads-vs-union-types.problem.ts(8,10): error TS2571: Object is of type 'unknown'.
89+
src/05-function-overloads/24-function-overloads-vs-union-types.problem.ts(8,10): error TS18046: 'generator' is of type 'unknown'.
9090
src/05-function-overloads/24-function-overloads-vs-union-types.problem.ts(18,23): error TS2344: Type 'false' does not satisfy the constraint 'true'.
9191
src/05-function-overloads/24-function-overloads-vs-union-types.problem.ts(26,23): error TS2344: Type 'false' does not satisfy the constraint 'true'.
9292
src/05-function-overloads/25-generics-in-function-overloads.problem.ts(14,23): error TS2344: Type 'false' does not satisfy the constraint 'true'.
@@ -98,8 +98,8 @@ src/05-function-overloads/27-use-data-hook.problem.ts(37,23): error TS2344: Type
9898
src/05-function-overloads/28-could-be-instantiated-with-subtype-of.problem.ts(11,43): error TS2322: Type '\\"a\\"' is not assignable to type 'TKey'.
9999
'\\"a\\"' is assignable to the constraint of type 'TKey', but 'TKey' could be instantiated with a different subtype of constraint '\\"a\\" | \\"b\\" | \\"c\\"'.
100100
src/05-function-overloads/28-could-be-instantiated-with-subtype-of.problem.ts(22,10): error TS2344: Type 'false' does not satisfy the constraint 'true'.
101-
src/06-challenges/29-infinite-scroll.problem.ts(5,16): error TS2571: Object is of type 'unknown'.
102-
src/06-challenges/29-infinite-scroll.problem.ts(8,24): error TS2571: Object is of type 'unknown'.
101+
src/06-challenges/29-infinite-scroll.problem.ts(5,16): error TS18046: 'params' is of type 'unknown'.
102+
src/06-challenges/29-infinite-scroll.problem.ts(8,24): error TS18046: 'params' is of type 'unknown'.
103103
src/06-challenges/29-infinite-scroll.problem.ts(36,5): error TS2578: Unused '@ts-expect-error' directive.
104104
src/06-challenges/29-infinite-scroll.problem.ts(69,12): error TS2344: Type 'false' does not satisfy the constraint 'true'.
105105
src/06-challenges/29.2-dynamic-function-arguments.problem.ts(16,3): error TS2578: Unused '@ts-expect-error' directive.
@@ -113,9 +113,9 @@ src/06-challenges/29.5-pick.problem.ts(6,16): error TS7053: Element implicitly h
113113
src/06-challenges/29.5-pick.problem.ts(23,22): error TS2344: Type 'false' does not satisfy the constraint 'true'.
114114
src/06-challenges/29.5-pick.problem.ts(36,7): error TS2578: Unused '@ts-expect-error' directive.
115115
src/06-challenges/30-form-validator.problem.ts(8,23): error TS2407: The right-hand side of a 'for...in' statement must be of type 'any', an object type or a type parameter, but here has type 'unknown'.
116-
src/06-challenges/30-form-validator.problem.ts(9,31): error TS2571: Object is of type 'unknown'.
117-
src/06-challenges/30-form-validator.problem.ts(10,23): error TS2571: Object is of type 'unknown'.
118-
src/06-challenges/30-form-validator.problem.ts(10,45): error TS2571: Object is of type 'unknown'.
116+
src/06-challenges/30-form-validator.problem.ts(9,31): error TS18046: 'config' is of type 'unknown'.
117+
src/06-challenges/30-form-validator.problem.ts(10,23): error TS18046: 'validators' is of type 'unknown'.
118+
src/06-challenges/30-form-validator.problem.ts(10,45): error TS18046: 'values' is of type 'unknown'.
119119
src/06-challenges/30-form-validator.problem.ts(23,14): error TS7006: Parameter 'value' implicitly has an 'any' type.
120120
src/06-challenges/30-form-validator.problem.ts(28,15): error TS7006: Parameter 'value' implicitly has an 'any' type.
121121
src/06-challenges/30-form-validator.problem.ts(33,11): error TS7006: Parameter 'value' implicitly has an 'any' type.
@@ -125,7 +125,7 @@ src/06-challenges/30-form-validator.problem.ts(83,5): error TS2578: Unused '@ts-
125125
src/06-challenges/32-data-fetcher-with-warning.problem.ts(22,12): error TS2344: Type 'false' does not satisfy the constraint 'true'.
126126
src/06-challenges/33-compose.problem.ts(21,24): error TS2344: Type 'false' does not satisfy the constraint 'true'.
127127
src/06-challenges/33-compose.problem.ts(28,5): error TS2578: Unused '@ts-expect-error' directive.
128-
src/06-challenges/34-internationalization.problem.ts(13,23): error TS2571: Object is of type 'unknown'.
128+
src/06-challenges/34-internationalization.problem.ts(13,23): error TS18046: 'translations' is of type 'unknown'.
129129
src/06-challenges/34-internationalization.problem.ts(16,43): error TS7006: Parameter '_' implicitly has an 'any' type.
130130
src/06-challenges/34-internationalization.problem.ts(16,46): error TS7006: Parameter 'key' implicitly has an 'any' type.
131131
src/06-challenges/34-internationalization.problem.ts(42,3): error TS2578: Unused '@ts-expect-error' directive.

0 commit comments

Comments
 (0)