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.
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
Bump typescript to 4.6.4 #879
Bump typescript to 4.6.4 #879
Changes from 14 commits
eda846e
6da59ae
281aff0
94b257d
32383d6
a19f309
f4eea57
e8e7915
c445087
cdc3344
84d5c7e
8fba865
df82abe
1885553
ed34ef5
4115c19
c707631
5dad068
1450d66
dbfb6b4
23dde58
2c4d894
4be4cbb
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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
@typescript-eslint/eslint-plugin: "^6.0.0"
requires at least node v16, but.nvmrc
contains14.20.0
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 don't love adding new code with
any
. Could this be cast asobject
orunknown
instead?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.
Maybe, we could consider completely removing this. Please look at the follow up issue #886
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.
Alternatively, we can add the following code to
index.d.ts
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.
Good point about fixing it by adding to global types. The usage of
any
is common to highlight areas of uncertainty or complexity in typescript. It is usually recommended to avoid it if possibleIn this case it should be safe to mark some pain point by
as any
. It could be more scary to cleanupindex.d.ts
in future, than cleanup local usage ofany
. My preference is to keep theindex.d.ts
nice and clean.On other hand I cant see better cast here and we have issue #886 for refactoring
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.
Love that we're able to get rid of this
@ts-ignore
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.
It looks like we're changing the return type to
string
fromstring | undefined
- is this intentional, and does it have any effect in caller contexts?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.
While i think it will impact the caller contexts, i believe the previous behavior of returning undefined was wrong.
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.
Why is
onPinClick
removed here? From a brief look at the code, it seems like it should be null checkedThere 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
onPinClick
is defined as required prop forOuiPinnableListGroup
component. Typescript will give error, ifonPinClick
is not provided. So no extra validation needed. I hope we can benefit from type checking hereThere 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.
Compile-time warning cannot take the place of proper guarding. There are many scenarios that TS will not be able check during compiling.
That said,
onPinClick
check shouldn't be up there but should be added down.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 committed the above suggestion.