Avatar ·

How to make TypeScript ignore the node_modules folder during compilation?

Hi everyone! I'm new to TypeScript and ran into a problem. When I run the `tsc` command in my project, the compiler starts checking all files in the `node_modules` folder. This takes a very long time and causes many errors. My project structure looks like this: ``` my-project/ ├── node_modules/ ├── src/ │ └── index.ts └── tsconfig.json ``` Here is my `tsconfig.json`: ```json { "compilerOptions": { "target": "ES2020", "module": "commonjs", "outDir": "./dist", "strict": true } } ``` When I run `tsc`, I get thousands of errors from `node_modules`, even though I'm not explicitly importing them in my code. I've already tried adding `"exclude": ["node_modules"]` to tsconfig.json, but it doesn't help. I also tried using `"skipLibCheck": true`, but that's not