Categories
TypeScript Answers

How to force TypeScript tsc to ignore node_modules folder?

Spread the love

Sometimes, we want to force TypeScript tsc to ignore node_modules folder.

In this article, we’ll look at how to force TypeScript tsc to ignore node_modules folder.

How to force TypeScript tsc to ignore node_modules folder?

To force TypeScript tsc to ignore node_modules folder, we can set the skipLibCheck option to true.

For instance, we write

{
  //...
  "compilerOptions": {
    "skipLibCheck": true
  }
  //...
}

to set the compilerOptions.skipLibCheck option to true in tsconfig.json to skip the node_modules folder check.

Conclusion

To force TypeScript tsc to ignore node_modules folder, we can set the skipLibCheck option to true.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

One reply on “How to force TypeScript tsc to ignore node_modules folder?”

Leave a Reply

Your email address will not be published. Required fields are marked *