wasp
wasp copied to clipboard
Use `strict: true` for TS for the SDK package
[!IMPORTANT] Edit by @sodic, before tackling this, take care of:
- #2010
- #1827
The d.ts
file are generated incorrectly if we use inferred function return type to define a type.
If I write a complex function like createAuthUser
that does some data transformation, I'd like to use typeof
to infer the final return value. Something like this:
type AuthType = ReturnType<typeof createAuthUser>
function createAuthUser() { ... }
Now, let's check the generate d.ts
files for this example (the strict one being the expected type):
strict: true |
strict: false |
You'll notice that the inferred return type is missing some of the type information, for example the identities being optional.