Conversation
|
@dependabot rebase |
8e0ad84 to
558c0fc
Compare
|
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. |
mukeshpanchal27
left a comment
There was a problem hiding this comment.
npm run tsc failed that need to check and fix.
|
I'm putting Claude on this... |
5b1e011 to
ef7ddd2
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## trunk #2434 +/- ##
=======================================
Coverage 69.33% 69.33%
=======================================
Files 90 90
Lines 7749 7749
=======================================
Hits 5373 5373
Misses 2376 2376
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
ef7ddd2 to
888df45
Compare
Bumps [typescript](https://github.com/microsoft/TypeScript) from 5.9.3 to 6.0.2. - [Release notes](https://github.com/microsoft/TypeScript/releases) - [Commits](microsoft/TypeScript@v5.9.3...v6.0.2) --- updated-dependencies: - dependency-name: typescript dependency-version: 6.0.2 dependency-type: direct:development update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <support@github.com>
888df45 to
dc16be6
Compare
Use truthiness guard for dataset.odXpath since DOMStringMap values are always strings when present. Add null check for getElementData() return value since the function legitimately returns ElementData | null. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Use getAttribute() with truthiness guards instead of hasAttribute() followed by getAttribute() with type casts. This lets TS naturally narrow the return value to string without explicit assertions. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
e2e2d43 to
9df901a
Compare
- Wrap Promise constructors with Promise<void> type assertions and use arrow function wrappers for event listener resolve callbacks, since TS6 no longer allows passing resolve directly as an EventListener - Use || '' fallback for sessionStorage.getItem() calls passed to parseInt(), since TS6 requires string arguments - Add explicit type arguments to bare Array<any> and Promise<void> generic types, which TS6 now requires - Add Record<string, any> type to recursiveFreeze parameter and Record<string, string> to headers object for proper index signatures - Add null guard for Object.assign with Map.get() result - Add compressedPayload truthiness check in ternary so TS narrows away null without a Blob cast - Cast getElementById result to HTMLElement for textContent access - Add string type assertions for getAttribute() return values where null is excluded by control flow Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add explicit array type for activationQueue with pluginSlug as string - Guard against missing pluginSlug in dataset with early return - Use shift() with undefined check instead of type cast for queue item - Use optional chaining for actionButtonList.appendChild() null check - Wrap enqueuePluginActivation in arrow function for addEventListener to resolve MouseEvent/Event type mismatch Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Remove custom Window.navigation declaration from types.ts since TS6 includes built-in Navigation API types that conflict with it - Add explicit type arguments to bare Array[] JSDoc types, which TS6 now requires (Array<Array<any>>) - Add null guards for navigation activation and URL properties instead of string type casts, using optional chaining to let TS narrow naturally Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Add JSDoc type annotations for implicit any parameters in cli.js, logger.js, and webpack.config.js - Add @ts-ignore for modules without declaration files (lodash, @wordpress/scripts configs) - Cast catch clause error variables to any for property access, since TS6 types caught errors as unknown by default - Add string type assertions for possibly-undefined command options - Add type predicate and Record casts in changelog.js for label filtering and PRIMARY_TYPE_LABELS indexing - Add Record<string, string> type for webpack manifest object - Add Compiler type annotation for webpack plugin apply callback Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
9df901a to
b47f810
Compare
bin/plugin/commands/changelog.js
Outdated
| /** | ||
| * @param {string|undefined} label - Label. | ||
| * @return {label is string} Whether label starts with type prefix. | ||
| */ ( label ) => |
There was a problem hiding this comment.
Can we move it to separate line?
Co-authored-by: mukeshpanchal27 <mukesh27@git.wordpress.org>
Bumps typescript from 5.9.3 to 6.0.2.
Release notes
Sourced from typescript's releases.
Commits
607a22aBump version to 6.0.2 and LKG9e72ab7🤖 Pick PR #63239 (Fix missing lib files in reused pro...) into release-6.0 (#...35ff23d🤖 Pick PR #63163 (Port anyFunctionType subtype fix an...) into release-6.0 (#...e175b69Bump version to 6.0.1-rc and LKGaf4caacUpdate LKG8efd7e8Merge remote-tracking branch 'origin/main' into release-6.0206ed1aDeprecate assert in import() (#63172)e688ac8Update dependencies (#63156)29b300dBump the github-actions group across 1 directory with 2 updates (#63205)0c2c7a3DOM update (#63183)TypeScript Fixes
Changes co-authored with Claude and the following was prepared by Claude as well.
Summary
Fix TypeScript 6 type errors across the codebase. TS6 introduces stricter type checking including: requiring explicit type arguments for generic types (
Array,Promise), typing catch clause variables asunknownby default, stricter nullable type narrowing, and built-in Navigation API types.Approach
Wherever possible, fixes use proper null guards and control flow narrowing instead of type casts, so that the code is genuinely safer at runtime — not just silencing the type checker.
Changes by scope
Embed Optimizer
dataset.odXpathinstead of type castgetElementData()return valueImage Prioritizer
getAttribute()with truthiness guards instead ofhasAttribute()+getAttribute()with type castsOptimization Detective
Promiseconstructors withPromise<void>type assertions; use arrow function wrappers for event listener resolve callbacks (TS6 no longer allows passingresolvedirectly as anEventListener)|| ''fallback forsessionStorage.getItem()passed toparseInt()ArrayandPromisegenericsRecordtypes torecursiveFreezeparameter andheadersobject for proper index signaturesObject.assignwithMap.get()resultcompressedPayloadtruthiness check in ternary to avoidBlobcastgetElementByIdresult toHTMLElementfortextContentaccessgetAttribute()where null is excluded by control flowPerformance Lab
pluginSlugfrom dataset with early return guardshift()with undefined check instead of type cast for queue processingactionButtonList?.appendChild()MouseEvent/Eventtype mismatchView Transitions
Window.navigationdeclaration that conflicts with TS6 built-in Navigation API typesArray[]JSDoc typesBuild Tools
@types/lodashfor proper type declarations@ts-ignorefor@wordpress/scriptsconfig modules (no types available)instanceof Errorchecks in catch clauses instead ofanycastsRecord<string, string>type for webpack manifest andCompilertype for webpack plugin callbackimport('commander').Commandtype for CLI command parametersince.jscontrol flow using directopt.plugintruthiness check