-
Notifications
You must be signed in to change notification settings - Fork 7.6k
Enable strictPropertyInitialization in TypeScript configs (#16671) #16683
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
Hi, thanks for your contribution! |
|
I separated the two issues into two separate PR. Extremely sorry for my unprofessional approach. |
|
@saghul could you please run the tests again as the Android SDK build problem has been solved in another PR. |
|
Can you please rebase, now that the CI is fixed? |
|
@saghul done |
|
@saghul @Calinteodor still I am getting this issue. |
|
I retried the job, looks like it got stuck in the next step, but the build was succesful. |
|
@saghul Thanks for helping me out. |
|
Hey @saghul, if you have a moment, could you provide some guidance on why this PR has not been merged? This will help me learn a lot on how open source actually works. |
|
Jenkins please test this please. |
Summary
Enables TypeScript's
strictPropertyInitializationcompiler flag in both web and native configurations to enforce proper class property initialization, improving type safety and catching potential undefined property access at compile time.Changes Made
1. TypeScript Configuration Updates
tsconfig.web.json: SetstrictPropertyInitialization: truetsconfig.native.json: SetstrictPropertyInitialization: true2. Property Initialization Fixes (19 files)
All class properties have been updated to satisfy the strict initialization requirement using two approaches:
Approach A: Direct Initialization - For properties with simple default values:
Approach B: Definite Assignment Assertion (!) - For properties initialized in lifecycle methods or abstract properties: