I have two projects: app and lib. app depends on lib.
app is a strict Typescript project, lib does not work with strict.
I've wired them together using Typescript Project References:
"compilerOptions": {
"strict": true,
},
"references": [
{ "path": "./apps/app" },
{ "path": "./libs/lib/" }
]
"extends": "../../tsconfig.json",
"references": [
{
"path": "../../libs/lib/tsconfig.json"
}
]
"extends": "../../tsconfig.json",
"compilerOptions": {
"composite": true,
"strict": false
},
But when I run app I get a failure because lib code is being run as if strict is true:
TSError: ⨯ Unable to compile TypeScript:
../../libs/lib/src/index.ts:4:3 - error TS2564: Property 'uninitializedProperty' has no initializer and is not definitely assigned in the constructor.
But lib specifies strict as false! It works fine if strict is just disabled. How can I configure Typescript so the projects are actually separate, and the code within each uses their own tsconfig options?
I've prepared an example repository here: https://github.com/gaggle/monorepo-tsconfig-experiment. Any thoughts and suggestions welcomed!
Just to put some context to my question: I'd like to move several projects to a single monorepo, but not all the code can use the same compiler options. The "strict" difference is an example of that, and I can't just fix the code so it all works with the same options.