Skip to content

fix(webdriverio): fix getHTML return-type#14832

Merged
christian-bromann merged 9 commits intowebdriverio:mainfrom
gavvvr:14827-fix-getHTML-types
Nov 23, 2025
Merged

fix(webdriverio): fix getHTML return-type#14832
christian-bromann merged 9 commits intowebdriverio:mainfrom
gavvvr:14827-fix-getHTML-types

Conversation

@gavvvr
Copy link
Contributor

@gavvvr gavvvr commented Oct 27, 2025

Fixes #14827

Proposed changes

Types of changes

  • Polish (an improvement for an existing feature)
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (improvements to the project's docs)
  • Specification changes (updates to WebDriver command specifications)
  • Internal updates (everything related to internal scripts, governance documentation and CI files)

Checklist

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have added the necessary documentation (if appropriate)
  • I have added proper type definitions for new commands (if appropriate)

Backport Request

//: # (The current main branch is the development branch for WebdriverIO v9. If your change should be released to the current major version of WebdriverIO (v8), please raise another PR with the same changes against the v8 branch.)

  • This change is solely for v9 and doesn't need to be back-ported
  • Back-ported PR at #XXXXX

Further comments

Reviewers: @webdriverio/project-committers

This will trigger ts(7023) on `WebdriverIO.Element#getHTML()`
…lement#getHTML()`

Fixes:
> 'getHTML' implicitly has return type 'any' because it does not have a return type annotation and is referenced directly or indirectly in one of its return expressions.ts(7023)
…arning

Fixes:
> Unexpected any. Specify a different type.eslint@typescript-eslint/no-explicit-any
@gavvvr
Copy link
Contributor Author

gavvvr commented Oct 27, 2025

@christian-bromann I've refactored from .d.ts to make TypeScript to be strict in terms of type checking. Type checking for .d.ts is too relaxed, so problems left unnoticed and caused the original bug.

Copy link
Member

@christian-bromann christian-bromann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@christian-bromann christian-bromann added the PR: Bug Fix 🐛 PRs that contain bug fixes label Nov 14, 2025
@christian-bromann christian-bromann merged commit 36cf622 into webdriverio:main Nov 23, 2025
17 of 20 checks passed
@wdio-bot
Copy link
Contributor

Hey gavvvr 👋

Thank you for your contribution to WebdriverIO! Your pull request has been marked as an "Expensable" contribution.

We've sent you an email with further instructions on how to claim your expenses from our development fund.
⚠️ You seemed to have committed using an email address ending up with @users.noreply.github.com, if you don't receive the email please feel free to reach out to us at expense@webdriver.io or in the contributing channel on Discord.

We are looking forward to more contributions from you in the future 🙌

Have a nice day,
The WebdriverIO Team 🤖

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Expensable $25 💸 PR: Bug Fix 🐛 PRs that contain bug fixes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[🐛 Bug]: Element#getHTML returns any since v9

3 participants