|
|
|
|
|
by eyelidlessness
1198 days ago
|
|
I make an exception for using any in type params which extend type params, eg const foo = <T extends Record<string, any>>(dict: T) => …
This is a good signal that foo maps over dict in some generic way that cares more about its dictionary-ness than its values. Sure, unknown works in that position too, but at least IMO the “doesn’t care” bit is more informative than “doesn’t know”. The latter might imply more type narrowing will happen than is the case. |
|