-
Notifications
You must be signed in to change notification settings - Fork 4.9k
ESLint: Ban @ts-ignore in favour of @ts-expect-error
#81148
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
Changes from all commits
8216c5f
d122236
5270d94
9241b10
260ea64
e2db290
14de80f
afb02be
99ac5c3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -105,7 +105,7 @@ function Icon( { | |
|
|
||
| if ( isValidElement( icon ) ) { | ||
| return cloneElement( icon, { | ||
| // @ts-ignore Just forwarding the size prop along | ||
| // @ts-expect-error `size` is forwarded but is not in the icon component overloads. | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This code is a little odd, both in terms of whether it even makes sense to pass through all these props blindly, or if we could be doing a better job of typing it such that we don't need to disable. Cursory review with AI shows it might be possible but not entirely straight-forward. |
||
| size, | ||
| width: size, | ||
| height: size, | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -60,7 +60,7 @@ export function useDragCursor( | |||||||||||||
| if ( isDragging ) { | ||||||||||||||
| document.documentElement.style.cursor = dragCursor; | ||||||||||||||
| } else { | ||||||||||||||
| // @ts-expect-error | ||||||||||||||
| // @ts-expect-error `cursor` is typed as `string`, but `null` clears it. | ||||||||||||||
| document.documentElement.style.cursor = null; | ||||||||||||||
|
Comment on lines
+63
to
64
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This looks like case where we're "doing it wrong" and could do this in a type-compliant way.
Suggested change
Setting to empty string removes the proeprty. Source:
https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty Setting to Source:
https://webidl.spec.whatwg.org/#LegacyNullToEmptyString
Suggested change
Ref: https://developer.mozilla.org/en-US/docs/Web/API/CSSStyleDeclaration/removeProperty |
||||||||||||||
| } | ||||||||||||||
| }, [ isDragging, dragCursor ] ); | ||||||||||||||
|
|
||||||||||||||
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.
For follow-up: The newest version does!
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.
Addressed in #81199