Description
TypeScript Version: 3.9.7
Search Terms:
skipLibCheck is ignored
skipLibCheck not working
Code
N/A
Expected behavior:
TypeScript should ignore type errors in node_modules (or skip reporting them? I'm not sure exactly what skipLibCheck
does).
Actual behavior:
When skipLibCheck
is set to true
, TS will still have type errors in packages in node_modules
. It seems that this is the case if a package's types
field in the package's tsconfig.json
file points to a .ts
file instead of a .d.ts
file.
For example, in my project that consumes the lume
package, there are type errors like these:
node_modules/lume/src/html/WithUpdate.ts:132:13 - error TS2784: 'get' and 'set' accessors cannot declare 'this' parameters.
132 get props(this: any): any {
~~~~~~~~~
node_modules/lume/src/core/Utility.ts:5:10 - error TS7030: Not all code paths return a value.
5 function applyCSSLabel(value: any, label: any) {
~~~~~~~~~~~~~
As you can see the path in the errors are in node_modules
. The lume
package's types
field points to its src/index.ts
file, and hence all the types in that package are based on .ts
files instead of .d.ts
files.
Playground Link:
N/A
Maybe I misunderstand what skipLibCheck
does. What should it do exactly?