Open dannypule opened 4 years ago
Unfortunately, it's not that simple to get rid of additional properties in TypeScript but I think it's not impossible.
I was very surprised to see in our codebase things being returned, that shouldn't have been. I guess it's not a major issue, but it does cause some confusion. Do you know how to solve it @the-dr-lazy?
There are some playgrounds (especially last playground) in #122 which I have done such thing.
This should fail because
otherNum
is not part of theState
interface:Typescript only displays a warning when the return type of
State
is explicitly defined but it would be nice to have it happen automatically