Skip to content

refactor(core): replace public any types with unknown#21249

Open
AI-DEV-BOT wants to merge 1 commit into
getsentry:developfrom
AI-DEV-BOT:fix/v11-public-type-unknown
Open

refactor(core): replace public any types with unknown#21249
AI-DEV-BOT wants to merge 1 commit into
getsentry:developfrom
AI-DEV-BOT:fix/v11-public-type-unknown

Conversation

@AI-DEV-BOT
Copy link
Copy Markdown

@AI-DEV-BOT AI-DEV-BOT commented May 29, 2026

Fixes #18570.

Summary

  • Replace the remaining TODO: fix in v11 public any types in core type definitions with unknown or Record<string, unknown>.
  • Type isInstanceOf around unknown inputs while keeping the existing invalid-constructor guard behavior.
  • Remove now-unnecessary Error assertions in aggregate error handling after the stricter type guard narrowing.

Validation

  • yarn oxfmt packages/core/src/types/error.ts packages/core/src/types/misc.ts packages/core/src/types/samplingcontext.ts packages/core/src/types/stackframe.ts packages/core/src/types/user.ts packages/core/src/utils/is.ts packages/core/src/utils/aggregate-errors.ts --check
  • yarn workspace @sentry/core build:types:core
  • yarn workspace @sentry/core test test/lib/utils/is.test.ts
  • OXLINT_TSGOLINT_DANGEROUSLY_SUPPRESS_PROGRAM_DIAGNOSTICS=true oxlint <changed files> --type-aware
  • git diff --check

Note: yarn workspace @sentry/core lint does not run directly in this Windows shell because the script uses Unix-style env assignment. Running the equivalent root oxlint . locally reports many unrelated type-aware errors on Windows, so I used the targeted lint above plus CI feedback.

@isaacs isaacs self-assigned this May 29, 2026
@isaacs isaacs self-requested a review May 29, 2026 14:51
@isaacs isaacs removed their assignment May 29, 2026
@isaacs isaacs added this to the 11.0.0 milestone May 29, 2026
@AI-DEV-BOT AI-DEV-BOT force-pushed the fix/v11-public-type-unknown branch from 16285e5 to ee9e0d8 Compare May 29, 2026 15:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clean up all TODO: fix in v11 comments

2 participants