Types: Replace remaining @ts-expect-error suppressions with proper typing - #81200
Merged
Conversation
Setting `style.cursor = null` relied on WebIDL's LegacyNullToEmptyString coercion and needed a `@ts-expect-error`. `removeProperty( 'cursor' )` does the same thing in a type-compliant way.
…-expect-errors Follow-up to review feedback on #81148: type each of these sites so the suppression is unnecessary rather than describing why it was needed. - Icon: type the cloned element's props as the sizing props it forwards. - Properties section: key `isVisibleFlag` to the `View` flags it indexes. - Block supports: type the object form of `spacing.blockGap`. - Background: narrow `backgroundImage` with a type predicate.
|
Size Change: +97 B (0%) Total Size: 7.81 MB 📦 View Changed
|
manzoorwanijk
marked this pull request as ready for review
August 5, 2026 05:27
manzoorwanijk
requested review from
a team,
ajitbohra,
gigitux,
ntsekouras and
oandregal
as code owners
August 5, 2026 05:27
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
Mamaduka
approved these changes
Aug 5, 2026
Mamaduka
left a comment
Member
There was a problem hiding this comment.
Nice cleanup. Thank you, @manzoorwanijk!
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What?
Follow up to #81148
Removes five
@ts-expect-errorsuppressions by typing the code properly instead of documenting why the suppression was needed.Why?
Review feedback on #81148 flagged several of the backfilled descriptions as cases where the disabling comment was hiding a fix rather than a genuine type limitation.
How?
input-control:document.documentElement.style.removeProperty( 'cursor' )instead of assigningnull, which only worked through WebIDL'sLegacyNullToEmptyStringcoercion.Icon: pass the forwarded sizing props as the type argument toisValidElement, socloneElementacceptssize/width/height.isVisibleFlagas'showTitle' | 'showMedia' | 'showDescription'so it can indexView. Removes two suppressions.spacing.blockGap({ __experimentalDefault?, sides? }), which blocks likecore/columnsalready use, and narrow at the call site in the global styles engine.backgroundImageto the member carrying aurlwith a type predicate.Two comments from the review are intentionally not addressed here, as both need more than a local fix:
inertindataviews-footer: React 18's types do not declare it and React 19's type it asboolean, so no single literal typechecks against both. The same suppression exists in@wordpress/boot, so this wants one shared answer.labelindataviews-filters/filter.tsx:getOperatorByNamereturns a union, so typing thebetweenoperator'sstring[]label means threading a new element type through every operator definition.Testing Instructions
No behaviour changes. CI type checks and unit tests cover this.
npm run build:package-typespasses.NumberControl/RangeControllabel still shows the drag cursor and restores the default cursor on release.Testing Instructions for Keyboard
N/A, no UI changes.
Use of AI Tools
The changes were drafted with Claude Code and reviewed by me.