Closed danielweinmann closed 3 months ago
I don't get this bug, isn't it what TS does by default?
What are we aiming for here?
IMO you should type your parameters as you do with any function, but wrapping it in a composable
will give ou composability and monadic error handling. When using withSchema
on the other hand, the parameters will infer the type of the schema given earlier and if none is given then the parameters will be unknown
.
I want to have the same error I get when using strict TS inside of composable. Here's an example:
const foo = (bar) => bar
// ^ Error TS7006: Parameter bar implicitly has an any type.
const foo2 = composable((bar) => bar)
// ^ No error whatsoever
Fair enough... so the problem is not that it is any
but the fact the lint isn't complaining, right?
I'll try to replicate to see what I can do about it
@gustavoguichard to be more precise, that is a TS error (no linting required).
Example: