There's more options than just --strict
, you can control it in a more fine grained way. This could be useful if you have a project that started without strict mode, but you want to turn it on. Here's the available options from the documentation:
Option | Type and Default | Description |
---|---|---|
--strict |
boolean false |
Enable all strict type checking options. Enabling --strict enables --noImplicitAny, --noImplicitThis, --alwaysStrict, --strictBindCallApply, --strictNullChecks, --strictFunctionTypes and --strictPropertyInitialization. |
--strictBindCallApply |
boolean false |
Enable stricter checking of the bind, call, and apply methods on functions. |
--strictFunctionTypes |
boolean false |
Disable bivariant parameter checking for function types. |
--strictPropertyInitialization |
boolean false |
Ensure non-undefined class properties are initialized in the constructor. This option requires --strictNullChecks be enabled in order to take effect. |
--strictNullChecks |
boolean false |
In strict null checking mode, the null and undefined values are not in the domain of every type and are only assignable to themselves and any (the one exception being that undefined is also assignable to void). |