News for hackers. Stuff that matters.
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by Dolores12 on Friday June 17, 2016 @01:31AM (#11920852)
TLDR: rename files to .ts, download type definitions for external libraries, silence TypeScript compiler warnings using 'any'
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by chrismbarr on Friday June 17, 2016 @07:52AM (#11922049)
Maybe initially, but that `any` type really defeats the purpose of having types in the first place. Where I work we have several 100% TS apps and we've banned the `any` type except for very rare exceptions. It's always better to define a type so that it can be easily used elsewhere, and it also helps prevent typos.
Re:Migrating a 10,000-line legacy JavaScript codebase to Typ... by k__ on Friday June 17, 2016 @07:59AM (#11922083)
for data objects (no methods) you could at least use Object instead of any, this should prevent anyone from calling methods on it.