TypeScript Version: 2.4.1
For example I want to consume a library from npm called awesome-lib
. This library already ships with a TypeScript type definition but this one is outdated and buggy. The author of the library doesn't update this one.
I've tried to disable that type definition completely in my own declarations.d.ts
file in my project:
declare module 'awesome-lib';
Unfortunately TypeScript reads first the type definition in the library and throws some errors. So it is not possible for me to disable / hide this library for my project.
Does anyone know how to disable type checking for one special library?
Maybe you could try to use require instead of import:
/* tslint:disable:no-var-requires */
const awesomeLib: any = require("awesome-lib");
/* tslint:enable:no-var-requires */
the downside is you have no type checking nor intellisense.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With