TypeScript allows us to use the --strict compilation flag to enable all strict type checking options. Enabling --strict enables --noImplicitAny, --noImplicitThis, --alwaysStrict, --strictPropertyInitialization, and --strictNullChecks:
- The --strictNullChecks compilation flag enables non-nullable types.
- The --noImplicitAny flag forces us to explicitly declare the type of a variable when the type inference system is not able to automatically infer the correct type.
- The --alwaysStrict flag forces the TypeScript parse to use the strict mode.
- The --noImplicitThis flag forces us to explicitly declare the type of the this operator in functions when the type inference system is not able to automatically infer the correct type.