Skip to content

fix(devtools): resolve ts7006 implicit-any bug - #333

Open
vedanshshetti wants to merge 4 commits into
vercel-labs:mainfrom
vedanshshetti:fix-internal
Open

fix(devtools): resolve ts7006 implicit-any bug#333
vedanshshetti wants to merge 4 commits into
vercel-labs:mainfrom
vedanshshetti:fix-internal

Conversation

@vedanshshetti

Copy link
Copy Markdown

Summary

This PR fixes TypeScript strict‑mode errors (TS7006: Parameter 'key' implicitly has an 'any' type) in the internal devtools packages by explicitly typing the selection.subscribe callback parameter as unknown. The issue appeared in both the React and Solid devtools implementations.

Changes

React_devtools_fix

Updated unsubSelection = selection.subscribe((key) => { ... }) to
unsubSelection = selection.subscribe((key: unknown) => { ... })
in packages/devtools-react/src/index.tsx.

Solid_devtools_fix

Applied the same fix in packages/devtools-solid/src/index.tsx for consistency.

Why this matters

Each item begins with a Guided Link.

TS_strict_mode

TypeScript’s strict mode flags untyped callback parameters as implicit any, which breaks builds and reduces type safety.

Internal_consistency

Both devtools implementations now use the same safe typing strategy, preventing future strict‑mode regressions.

Zero_runtime_change

This PR only affects type annotations. No runtime behavior or public API surface is changed.

Scope

This PR is strictly internal cleanup.
It does not modify logic, behavior, or user‑facing features.

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown
Contributor

@vedanshshetti is attempting to deploy a commit to the Vercel Labs Team on Vercel.

A member of the Team first needs to authorize it.

allowDockToggle: props.allowDockToggle,
});
unsubSelection = selection.subscribe((key) => {
unsubSelection = selection.subscribe((key: unknown) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
unsubSelection = selection.subscribe((key: unknown) => {
unsubSelection = selection.subscribe((key) => {

selection.subscribe callback param typed (key: unknown) fails type-check because narrowed {} is not assignable to highlightElement's string parameter (TS2345)

Fix on Vercel


// Highlight in the host DOM as the selection changes.
const unsubSelection = selection.subscribe((key) => {
const unsubSelection = selection.subscribe((key: unknown) => {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
const unsubSelection = selection.subscribe((key: unknown) => {
const unsubSelection = selection.subscribe((key) => {

Annotating the selection.subscribe callback parameter as (key: unknown) breaks the type-check because highlightElement requires a string, but unknown narrowed by if (key) becomes {}.

Fix on Vercel

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant