Description
Today, I have learned about some new (~1-2 year old) compiler options of TypeScript which help to write better code and prevent errors. That is why I suggest that we implement this flag (called strict
mode) in this library and also in all Angular/TypeScript projects that we have.
From the documentation:
Enable all strict type checking options.
Enabling --strict enables --noImplicitAny, --noImplicitThis, --alwaysStrict, --strictBindCallApply, --strictNullChecks, --strictFunctionTypes and --strictPropertyInitialization.
Source: https://www.typescriptlang.org/docs/handbook/compiler-options.html
To summarize: The compiler option strict
enables seven flags that help you write better code. It is possible that in future releases more flags will be added.
As of now, we only have two flags set in this library: noImplicitAny
and strictNullChecks
. I suggest we remove those two flags from tsconfig.json
and replace it with strict: true
.