Skip to content

chore(lint): Enable type-aware Oxlint rules disabled in #1556 - #1578

Open
sentry-junior[bot] wants to merge 1 commit into
mainfrom
byk/enable-type-aware-lint-rules
Open

sentry-junior[bot] wants to merge 1 commit into
mainfrom
byk/enable-type-aware-lint-rules

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 21, 2026

Copy link
Copy Markdown
Contributor

Turns back on the nine type-aware rules #1556 switched off (await-thenable, no-base-to-string, no-duplicate-type-constituents, no-floating-promises, no-misused-spread, no-redundant-type-constituents, require-array-sort-compare, restrict-template-expressions, unbound-method) and fixes the ~640 violations they reported.

Most fixes are mechanical. These ones are worth a look:

  • Real bugs found by the rules: some async property tests and LoggingUI rejection assertions were never awaited, so they could pass without running. Smoke-test headers object-spread HeadersInit, which silently drops entries from a Headers instance; they now go through Headers. Fetch wrappers called String(input) on Request | URL | string, which gives [object Request] for requests; a new CLI fetchInputUrl() helper reads the URL properly.
  • Stringifying unknowns: places that interpolated or String()'d unknown values now use the CLI's stringifyUnknown() or MCP's formatUnknown(), so objects show up as JSON instead of [object Object]. formatUnknown moved to mcp-core/src/internal/unknown-formatting.ts so internal formatters don't import from tools/ (it's still re-exported from api-formatting). Spotlight envelope IDs are UUID objects with their own toString(), so they get a small spotlightEnvelopeId() helper.
  • Types: TraceSpanSchema now uses Zod 4's getter-based recursion instead of z.lazy(...) as z.ZodType<any>. That any was hiding redundant union members.
  • Dead code: removed the unused getSentryConfig.partial from the Cloudflare Sentry config. It was the only no-misused-spread hit that needed real changes.

Config tweaks instead of blanket disables:

  • no-floating-promises uses allowForKnownSafeCalls for node:test's test/it/describe/suite.
  • restrict-template-expressions allows never (exhaustive-switch error messages).
  • unbound-method is off only in test files, where mock and identity assertions like expect(obj.method) trip it all the time.

Fixes #1573

via BYK.

--

View Junior Session in Sentry

Turn the nine type-aware rules back on and fix the violations they
report: drop awaits on non-thenables, mark intentional fire-and-forget
promises with void, await forgotten assertions, give sorts explicit
comparators, stop stringifying unknown values to "[object Object]", and
remove redundant type constituents.

no-floating-promises allows node:test's test/describe helpers,
restrict-template-expressions allows never, and unbound-method stays off
in tests, where mock and identity assertions trip it.

Fixes #1573

Co-Authored-By: BYK <burak.kaya@sentry.io>
@vercel

vercel Bot commented Oct 21, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-local Ready Ready Preview Oct 21, 2026 5:44pm UTC

Request Review

This branch was successfully deployed

2 active deployments
Preview — aa6ce601 Deployed Oct 21, 2026 by vercel[bot]
Actions — aa6ce601 Deployed Oct 21, 2026 by sentry-junior[bot] via eval #1349
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.

Enable type-aware Oxlint rules turned off in #1556

0 participants