Is it possible to opt-in to TypeScript's strictPropertyInitialization on a per-file basis?
Is it possible to opt-in to TypeScript's strictPropertyInitialization on a per-file basis?
We cannot opt-in to TypeScript's strictPropertyInitialization on a per-file basis, because it is a type-checking compile flag, and overriding a type-checking compile flag on a per-file basis is not possible. This issue requested that feature in April 2016, and the TypeScript team closed the issue as "too complex". The comments in the issue offer an explanation and several workarounds.