-
Notifications
You must be signed in to change notification settings - Fork 516
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
Enable noUncheckedIndexedAccess in tsconfig #9878
Comments
can I work on this @amjithtitus09 @rithviknishad |
@Utkarsh-Anandani Check the updated Issue description regarding the process to get the issue assigned |
Hey @amjithtitus09 , I would like to work on this issue. As I would make "noUncheckedIndexedAccess": true and compile the code accordingly and manually fix the errors probably checking undefined or null before accessing the array indices |
Hi @amjithtitus09 Changes: Added "noUncheckedIndexedAccess": true to compilerOptions. |
Hey @amjithtitus09 , Enabling this option often leads to errors in the following cases: Array Access: Accessing an array without null-checking or type guards. Approach to Resolve Errors
After enabling and fixing errors: All the changes would be done latest before 12 midnight today (4 - 5 hours) . Please assign this task to me |
@amjithtitus09
Solution:
2.Use Type Narrowing Here I fixed an error by a simple change and as I have noticed most of the error will be fixed using this 5 solution will fix these all type error by Today (5 to 6 hours), Please assign this task to me |
if this is correct Please assign this to me. I will make the PR by 6 or 7 PM by today |
hi @amjithtitus09 Most of erros are
They are slove through following pratices. Use optional chaining (?.) to safely access properties of potentially undefined objects. I will Complete the PR By tonight 10 PM |
Enable
The following errors can be fixed by using basic |
@amjithtitus09 I have raised the PR let me know if any changes are required |
Hey @Rishith25 , I don't think this was supposed to be assigned on the basis of who first creates PR. We all actually waiting for final assignment result. I had also started working but would only raise PR if it gets assigned to me 😕 |
I have asked it in the slack and Gigin told me to raise the PR |
We need enable
noUncheckedIndexedAccess
incompilerOptions
in tsconfig.jsonEnabling this unveils quite a few TypeScript errors which would have to be solved as part of enabling this option. These would need to be resolved within the PR for it to be considered as an acceptable solution.
The text was updated successfully, but these errors were encountered: