This means we will not get compilation error on many things when building ui-core-react. However, this might cause problems when the project that consumes ui-core-react use strict mode.
Solution
We need to enable strict mode on our TypeScript. However, this would cause 250+ compilation errors (v5.6.2) if we just set strict: true on tsconfig.
Therefore we need to incrementally enable strict mode and fix them gradually.
Options for Incremental Migration to TypeScript Strict Mode
Generally, one need to:
(optional) maybe upgrade to TypeScript 4.6 or even 5? Currently, we're stil using v3.9 which is from 2020.
Problems
Currently, we are compiling UI Core React without strict mode https://github.com/eBay/ebayui-core-react/blob/abd3bb3ca6eef208bb8d3bf3dce68ff25bf60097/tsconfig.json#L17
This means we will not get compilation error on many things when building ui-core-react. However, this might cause problems when the project that consumes ui-core-react use strict mode.
Solution
We need to enable strict mode on our TypeScript. However, this would cause 250+ compilation errors (v5.6.2) if we just set
strict: true
on tsconfig.Therefore we need to incrementally enable strict mode and fix them gradually.
Options for Incremental Migration to TypeScript Strict Mode
Generally, one need to:
strict: true
on tsconfig, which actually enabling at least 5 strict mode family optionsSee details on this article: https://www.bitovi.com/blog/how-to-incrementally-migrate-an-angular-project-to-typescript-strict-mode
Other techniques:
Plan by Tim:
Step 1
strictBindCallApply
useUnknownInCatchVariables
noImplicitThis
alwaysStrict
Step 2
strictFunctionTypes
21 errorsStep 3
strictNullChecks
150+ errorsstrictPropertyInitialization
requiresstrictNullChecks
Step 4
noImplicitAny
300+ errors