-
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
noUncheckedIndexedAccess in tsconfig #9880
Open
Rishith25
wants to merge
15
commits into
ohcnetwork:develop
Choose a base branch
from
Rishith25:tsc-config
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 11 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
356f18a
noUncheckedIndexedAccess in tsconfig
Rishith25 2f356a2
resolved coderabbit changes
Rishith25 260e7fd
resolved coderabbit changes
Rishith25 5c5d3cd
optimized and removed redundant conditions
Rishith25 347fa08
Merge branch 'develop' into tsc-config
Rishith25 7e25a9b
naviagte in useAppHistory
Rishith25 57c8e5a
coderabiitai change
Rishith25 2e4e860
Merge branch 'develop' into tsc-config
Rishith25 6de2db1
wrong file added
Rishith25 46d564d
resolved the errors
Rishith25 8671dfd
done suggested changes
Rishith25 2a73a31
coderabbit changes
Rishith25 6fc0471
Merge branch 'develop' into tsc-config
rithviknishad c667672
resolved the deploy failed error
Rishith25 321c635
Merge branch 'develop' into tsc-config
Rishith25 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would the component work with
""
being passed to the id fields?i mean, the whole reason for adding this strict check is so that it's super safe. i don't see much advantage in enabling this check when we are anyways gonna fallback to empty string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rithviknishad you are right. Falling back to an empty string defeats the purpose of strict checks.
I’m planning to display the ErrorPage when the parameters are undefined or invalid:
Does this approach align with what you had in mind?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the root issue seems to be with the implementation of
AppRoutes
type itself. It should've inferred type as string automatically instead, hence these checks wouldn't be needed in the first place.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what we have now:
what's expected:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We won't need these checks with #9890 i believe
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i did check after enabling this config in that branch, it still gives string | undefined after enabling it. (atleast it's not never)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rithviknishad So should i follow this approach to handle the undefined right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we'll need a better solution than that 😅 this approach is not maintainable. with too many routes, repeating this logic is quite cumbersome.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(there's a reason for the issue being 6 story points) 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rithviknishad I have found two methods
by 2nd method params are of type any and if we declare the param types as string
Currently trying to finding more methods to infer params as directly string instead of string | undefind or never