Re:Convert React JavaScript Code to TypeScript with Proper T...
by brlewis on Tuesday January 16, 2018 @05:50PM
(#16163537)
I'd be interested to know how many DefinitelyTyped contributors agree with the "usually" part. My impression is that problems specifying types for existing libraries are the exception rather than the rule.
[ Parent
| on HN ]
Re:Convert React JavaScript Code to TypeScript with Proper T...
by shados on Tuesday January 16, 2018 @09:07PM
(#16164875)
Many non-trivial libs are typed improperly, even when they can be done right. There's massive abuse of "any" type the moment anything gets semi-challenging. Also, a non-trivial amount of type definitions don't work in strict mode, which make things worse.
Anything involving complicated higher order functions (like lodash/ramda's curry), or having a single method that can be used in various ways that don't fit well with TS' overloading mechanisms are often done wrong or poorly. Flow is a bit better at this, but the techniques it provides are not always well known, so the type definitions aren't that much better.
Re:Convert React JavaScript Code to TypeScript with Proper T...
by aphexairlines on Tuesday January 16, 2018 @08:05PM
(#16164564)
Well, there are over 10,000 occurrences of 'any' (which effectively gives up on type checking) in the DefinitelyTyped repository:
https://github.com/DefinitelyTyped/DefinitelyTyped/search?q=...