no-skip-lib-check
Discourage skipLibCheck: true because it silences type errors in declaration
files from dependencies, masking real bugs.
Targeted pattern scopeโ
The compilerOptions.skipLibCheck field in any tsconfig*.json file.
What this rule reportsโ
This rule reports when compilerOptions.skipLibCheck is set to true.
Why this rule existsโ
skipLibCheck: true tells TypeScript to skip type-checking of all .d.ts
files. While this can speed up compilation and unblock projects with broken
third-party type definitions, it has a high cost: any type error in a
dependency's declaration file โ including errors that would affect your own
code โ is silently ignored.
Common consequences include:
- A dependency ships a broken overload. Without
skipLibCheckTypeScript would report it at the call site; withskipLibCheckthe call compiles but fails at runtime. - A package's
.d.tsuses a type that conflicts with a sibling dependency.skipLibCheckhides the conflict, leaving it to surface as a runtime exception.
The recommended alternative is to update the dependency, override the type
with a local declaration, or use skipDefaultLibCheck to skip only the
TypeScript built-in libraries if that is the specific pain point.
โ Incorrectโ
{
"compilerOptions": {
"skipLibCheck": true
}
}
โ Correctโ
Remove the option entirely or set it to false:
{
"compilerOptions": {
"strict": true
}
}
If only the built-in TypeScript lib files are causing issues:
{
"compilerOptions": {
"skipDefaultLibCheck": true
}
}
When not to use itโ
Disable this rule when a third-party dependency ships incompatible declaration
files that cannot be patched or overridden, and the only way to unblock the
project in the short term is skipLibCheck: true. Track the root cause as a
separate issue.
Package documentationโ
Rule catalog ID: R013