Skip to content

fix(base,icon-registry): replace unsafe Function type with explicit signatures#1273

Merged
iOvergaard merged 2 commits intorelease/2.0from
v2/improvement/fix-eslint-warnings
Feb 16, 2026
Merged

fix(base,icon-registry): replace unsafe Function type with explicit signatures#1273
iOvergaard merged 2 commits intorelease/2.0from
v2/improvement/fix-eslint-warnings

Conversation

@iOvergaard
Copy link
Copy Markdown
Contributor

Summary

  • Replace Function type with () => void in Timer constructor (uui-base)
  • Replace Function types with explicit (value: string) => void and (reason?: unknown) => void in UUIIconHost (uui-icon-registry)

Fixes @typescript-eslint/no-unsafe-function-type warnings.

Test plan

  • TypeScript compilation passes for uui-base and uui-icon-registry
  • CI passes

🤖 Generated with Claude Code

…ignatures

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings February 16, 2026 14:44
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1273.westeurope.azurestaticapps.net

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR addresses @typescript-eslint/no-unsafe-function-type warnings by replacing broad Function types with explicit callback signatures in two exported utilities (Timer in uui-base, and UUIIconHost in uui-icon-registry).

Changes:

  • Tighten UUIIconHost’s internal resolve and public reject types to explicit promise resolver/rejector signatures.
  • Tighten Timer’s constructor callback type from Function to () => void.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
packages/uui-icon-registry/lib/UUIIconHost.ts Replaces Function with explicit resolve/reject function signatures.
packages/uui-base/lib/utils/Timer.ts Replaces Function with an explicit no-arg callback signature for the timer completion callback.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread packages/uui-icon-registry/lib/UUIIconHost.ts
Comment thread packages/uui-base/lib/utils/Timer.ts Outdated
@nielslyngsoe
Copy link
Copy Markdown
Member

@iOvergaard seems like good changes, I think (this as any) could be removed then.

I dont feel super streong about the second co-pilot comment, I think its fair that we take no arguments and that it does not return anything. So okay with me to pass that comment.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
@sonarqubecloud
Copy link
Copy Markdown

@iOvergaard iOvergaard merged commit c27b8f7 into release/2.0 Feb 16, 2026
11 of 12 checks passed
@iOvergaard iOvergaard deleted the v2/improvement/fix-eslint-warnings branch February 16, 2026 15:14
@github-actions
Copy link
Copy Markdown

Azure Static Web Apps: Your stage site is ready! Visit it here: https://delightful-beach-055ecb503-1273.westeurope.azurestaticapps.net

@iOvergaard iOvergaard added enhancement New feature or request breaking Breaks existing functionality labels Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking Breaks existing functionality enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants