user4639920
user4639920

Reputation:

how to skip typescript's noImplicitAny=true rule on node modules packages?

I'm building angular 2 app using Typescript 2 and Webpack 2. As a loader I use awesome-typescript-loader. I set noImplicitAny = true in tsconfig.json. But some of npm packages I used implicitly has an 'any' type. (e.g. angular2-platform-node). So I want to skip that rule only on npm packages but not on my app source. How can I configure for that?

Upvotes: 9

Views: 6432

Answers (1)

Aleksey L.
Aleksey L.

Reputation: 37918

You can skip type checking for all declaration files with skipLibCheck compiler option (added in typescript 2.0)

{
  "compilerOptions": {
    "noImplicitAny": true,
    "skipLibCheck": true,
    ...
}

Upvotes: 7

Related Questions