4 ms·
Explicit any is usually also easy enough of a hassle to deal with: when you get a compiler complaint add an `: any` or `as any` somewhere and whatever necessary
by WorldMaker 10y ago
Explicit any is usually also easy enough of a hassle to deal with: when you get a compiler complaint add an `: any` or `as any` somewhere and whatever necessary parentheses to scope that right. Optional: treat `: any` and `as any` as TODO or HACK markers to return to in the fullness of time (refactoring/fixing).
Dealing with other people's modules has also gotten much easier in recent versions of Typescript. To define a module name as any-typed the boilerplate has shrunk to a bare minimum:
declare module 'name-of-the-module'
Even better, module names in recent Typescript versions accept wildcards:
declare module 'some-big-node-library/**/*'
declare module '**/*.css'
declare module '**/*!text'