17

I have turned on some compiler switches to report more issues in code (e.g. strict null checks). But I get tens of errors in used libraries, e.g.:

[default] xxx/node_modules/@angular/core/src/util/decorators.d.ts:11:5
    Property 'extends' of type 'Type<any> | undefined' is not assignable to string index type 'Function | any[] | Type<any>'.

Is there any way of suppressing/muting/disabling error checking in libraries (e.g. directory node_modules)?


It can't be a duplicate of Allow implicit any only for definition files because my question is much broader. I am not asking how to disable one specific check (noImplicitAny) in libraries, but how to disable all checks in libraries. However the answer from that question applies to mine as well - "skipLibCheck": true disables all checks in libraries.

Community
  • 1
  • 1
monnef
  • 3,903
  • 5
  • 30
  • 50
  • 1
    Possible duplicate of [Allow implicit any only for definition files](http://stackoverflow.com/questions/38656955/allow-implicit-any-only-for-definition-files) – cartant Oct 26 '16 at 12:54

1 Answers1

32

While this question is not a duplicate of Allow implicit any only for definition files the answer https://stackoverflow.com/a/39917362/1017211 from over there does solve my issue.

Edit tsconfig.json:

{
    "compilerOptions": {
        "skipLibCheck": true,
        ...
    },
    ...
}
Community
  • 1
  • 1
monnef
  • 3,903
  • 5
  • 30
  • 50
  • 1
    I have set `skipLibCheck: true` but I have ts errors in one library. The only lib that I have installed directly from github (the rest is coming from the standard npm repo). Any idea why skipLibCheck does not work here? – andymel Aug 06 '23 at 16:10