You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently many of the exported types are any or very weakly typed.
It would be great if these types could be properly populated via the jsdoc.
For example, the various places you can pass options tend to accept any even though we have a strong type for the user options already.
I did actually start doing this but the overloads you have lead to a lot of craziness in the types.
For example, if we strongly type the overloads of resolve, the tests fail to compile because there are some which explicitly pass in undefined to ensure an error is thrown rather than bailing.
These tests make perfect sense but mean we end up having to dumb down the types to signatures nobody should ever really use. Alternatively we can double-cast undefined via jsdoc (to unknown then to string).
Similarly, the various overloads lead to all sorts of funky types, but are ultimately doable at least.
Maybe if i at least put a draft pr up, you can see what i mean.
cc @sokra maybe if you can list the "officially supported" overloads, that'd help us write the correct types
The text was updated successfully, but these errors were encountered:
Currently many of the exported types are
any
or very weakly typed.It would be great if these types could be properly populated via the jsdoc.
For example, the various places you can pass options tend to accept
any
even though we have a strong type for the user options already.I did actually start doing this but the overloads you have lead to a lot of craziness in the types.
For example, if we strongly type the overloads of
resolve
, the tests fail to compile because there are some which explicitly pass inundefined
to ensure an error is thrown rather than bailing.These tests make perfect sense but mean we end up having to dumb down the types to signatures nobody should ever really use. Alternatively we can double-cast undefined via jsdoc (to
unknown
then tostring
).Similarly, the various overloads lead to all sorts of funky types, but are ultimately doable at least.
Maybe if i at least put a draft pr up, you can see what i mean.
cc @sokra maybe if you can list the "officially supported" overloads, that'd help us write the correct types
The text was updated successfully, but these errors were encountered: