Skip to content

Be able to change skipLibCheck flag in command lineΒ #45691

Closed

Description

Suggestion

Add a new --skipLibCheck [bool] flag to tsc when using --build. This flag would override the skipLibCheck value in all tsconfig.json files for all projects checked in the build.

πŸ” Search Terms

performance
skipLibCheck

βœ… Viability Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.

⭐ Suggestion

We are interested in leveraging skipLibCheck when using the typescript checker in order to avoid expensive checks on large .d.ts files from external libraries that we include as node modules. That said, we recognize that there is some danger in skipLibCheck. For example, a third party module may have been checked with a different version of tsc, or with different levels of strictness. We would feel more comfortable with a workflow that allows us to check libs when we import a new version of a node module, upgrade the tsc compiler, or change compiler flags.

In order to do this, we request that tsc support a --skipLibCheck (bool) flag when using --build. This flag would override the skipLibCheck compiler option in the tsconfig.json file (and the tsconfig.json file for all project references).

πŸ“ƒ Motivating Example

As a motivating example, node_modules/@types/lodash/ts3.1/common/common.d.ts, a dependency we take in all of our projects, takes 1.25 seconds to check on my dev machine. Without skipLibCheck, the overhead of splitting our monorepo into smaller projects is too high to justify the work.

πŸ’» Use Cases

We generally want to set "skipLibCheck": true in our tsconfig.json files, but we want a workflow that allows us to check libs when we import a new version of a node module, upgrade the tsc compiler, or change compiler flags.

Activity

  1. MartinJohns commented on Sep 2, 2021

    @MartinJohns
    Contributor

    Duplicate of #25613.

  2. MartinJohns commented on Sep 2, 2021

    @MartinJohns
    Contributor

    In the meantime you could create a second tsconfig file that extends your existing one, and just changes the skipLibCheck value. Then when executing the compiler point to your second config file.

  3. MarcCelani-at commented on Sep 2, 2021

    @MarcCelani-at
    Author
  4. typescript-bot commented on Sep 7, 2021

    @typescript-bot
    Contributor

    This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

  5. locked as resolved and limited conversation to collaborators on Oct 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    DuplicateAn existing issue was already created

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions