4 ms·
> I've seen some insane Typescript type definitions. That's just because the code is bad, not because the type is bad. That's literally just the definition of
by david422 3y ago
> I've seen some insane Typescript type definitions.
That's just because the code is bad, not because the type is bad.
That's literally just the definition of, this code is so bad, let's just not type it.
- digging 3y agoAgreed. I've left a few `any`s or `as unknown as X` in place before and typically leave a comment alongside it. Something to the effect of: "This code is bad and will take too long to refactor. Every time you trace a bug back to this code, please adjust the logic and typing a little bit to prevent the kind of bug you encountered. Eventually we can replace this bad code with good code."