How to Exclude a Specific Folder from TypeScript's Strict Type Checking in an Angular Project?

26 Views Asked by At

I'm working on an Angular project with a strict type checking enabled "strict": true in tsconfig.json. The project structure includes a folder named 3rdparty within src/app/shared/, which contains third-party TypeScript code that I don't have control over. This code is not compatible with strict type checking, and I want to exclude it from the strict checks without affecting the rest of the project.

I tried to create a separate tsconfig file tsconfig.non-strict.json with "strict": false inside the 3rdparty folder. However, I am not sure how to integrate this into the Angular CLI's build process so that it respects the non-strict settings for just this folder.

Additionally, when I run ng serve, the Angular CLI outputs strict type checking errors that originate from within the 3rdparty folder, despite my attempts to exclude it from strict checks.

0

There are 0 best solutions below