Skip to main content

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 skipLibCheck TypeScript would report it at the call site; with skipLibCheck the call compiles but fails at runtime.
  • A package's .d.ts uses a type that conflicts with a sibling dependency. skipLibCheck hides 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

Further readingโ€‹