Skip to content

chore(lint): resolve oxlint warnings#19893

Merged
isaacs merged 2 commits intodevelopfrom
isaacs/chore-lint-warnings
Mar 19, 2026
Merged

chore(lint): resolve oxlint warnings#19893
isaacs merged 2 commits intodevelopfrom
isaacs/chore-lint-warnings

Conversation

@isaacs
Copy link
Copy Markdown
Member

@isaacs isaacs commented Mar 19, 2026

  • Turn off no-base-to-string, as we rely on casting things to strings in many places after verifying that they are simple not-falsey. It could be worthwhile to impose better type safety on all these things at some point, but that is unlikely to be worth doing in the near term.
  • Remove several unused variables. We could consider disabling this rule in tests specifically, since that is where it's most common to leave scaffolding and debugging values behind.
  • Cast as types in a few cases to make our intention clear, where the values were actually being used safely, but not explicitly.
  • Disable require-array-sort-compare in one case where we benefit with a smaller code footprint by using the implicit numeric comparison on Array.sort().

Closes #19894 (added automatically)

- Turn off `no-base-to-string`, as we rely on casting things to strings
  in many places after verifying that they are simple not-falsey. It
  could be worthwhile to impose better type safety on all these things
  at some point, but that is unlikely to be worth doing in the near
  term.
- Remove several unused variables. We could consider disabling this rule
  in tests specifically, since that is where it's most common to leave
  scaffolding and debugging values behind.
- Cast as types in a few cases to make our intention clear, where the
  values were actually being used safely, but not explicitly.
- Disable `require-array-sort-compare` in one case where we benefit with
  a smaller code footprint by using the implicit numeric comparison on
  `Array.sort()`.
@isaacs isaacs requested a review from a team as a code owner March 19, 2026 18:29
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

Semver Impact of This PR

🟢 Patch (bug fixes)

📋 Changelog Preview

This is how your changes will appear in the changelog.
Entries from this PR are highlighted with a left border (blockquote style).


New Features ✨

Deps

  • Bump mongodb-memory-server-global from 10.1.4 to 11.0.1 by dependabot in #19888
  • Bump stacktrace-parser from 0.1.10 to 0.1.11 by dependabot in #19887

Bug Fixes 🐛

  • (deps) Bump socket.io-parser to 4.2.6 to fix CVE-2026-33151 by chargome in #19880
  • (nestjs) Add node to nest metadata by chargome in #19875
  • (serverless) Add node to metadata by nicohrubec in #19878

Internal Changes 🔧

  • (astro) Re-enable server island tracing e2e test in Astro 6 by Lms24 in #19872
  • (lint) Resolve oxlint warnings by isaacs in #19893
  • (node-integration-tests) Remove unnecessary file-type dependency by Lms24 in #19824

🤖 This preview updates automatically when you update the PR.

Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Lint suppression based on incorrect Array.sort() assumption
    • Replaced bare sort() with sort((a, b) => a - b) in getEarliestTimestamp and removed the lint suppression so ordering is explicitly numeric.

Create PR

Or push these changes by commenting:

@cursor push 85fb3438e1
Preview (85fb3438e1)
diff --git a/packages/replay-internal/src/eventBuffer/EventBufferArray.ts b/packages/replay-internal/src/eventBuffer/EventBufferArray.ts
--- a/packages/replay-internal/src/eventBuffer/EventBufferArray.ts
+++ b/packages/replay-internal/src/eventBuffer/EventBufferArray.ts
@@ -73,8 +73,7 @@
 
   /** @inheritdoc */
   public getEarliestTimestamp(): number | null {
-    //oxlint-disable-next-line require-array-sort-compare
-    const timestamp = this.events.map(event => event.timestamp).sort()[0];
+    const timestamp = this.events.map(event => event.timestamp).sort((a, b) => a - b)[0];
 
     if (!timestamp) {
       return null;

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Comment thread packages/replay-internal/src/eventBuffer/EventBufferArray.ts Outdated
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

size-limit report 📦

⚠️ Warning: Base artifact is not the latest one, because the latest workflow run is not done yet. This may lead to incorrect results. Try to re-run all tests to get up to date results.

Path Size % Change Change
@sentry/browser 25.52 kB -0.44% -112 B 🔽
@sentry/browser - with treeshaking flags 24.04 kB -0.43% -102 B 🔽
@sentry/browser (incl. Tracing) 42.5 kB -0.27% -115 B 🔽
@sentry/browser (incl. Tracing, Profiling) 47.17 kB -0.23% -105 B 🔽
@sentry/browser (incl. Tracing, Replay) 81.32 kB -0.13% -102 B 🔽
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 70.89 kB -0.16% -108 B 🔽
@sentry/browser (incl. Tracing, Replay with Canvas) 86.02 kB -0.12% -102 B 🔽
@sentry/browser (incl. Tracing, Replay, Feedback) 98.28 kB -0.1% -96 B 🔽
@sentry/browser (incl. Feedback) 42.35 kB -0.24% -99 B 🔽
@sentry/browser (incl. sendFeedback) 30.2 kB -0.37% -110 B 🔽
@sentry/browser (incl. FeedbackAsync) 35.25 kB -0.32% -110 B 🔽
@sentry/browser (incl. Metrics) 26.81 kB -0.43% -115 B 🔽
@sentry/browser (incl. Logs) 26.95 kB -0.43% -116 B 🔽
@sentry/browser (incl. Metrics & Logs) 27.64 kB -0.38% -103 B 🔽
@sentry/react 27.3 kB -0.34% -93 B 🔽
@sentry/react (incl. Tracing) 44.86 kB -0.21% -91 B 🔽
@sentry/vue 29.99 kB -0.32% -94 B 🔽
@sentry/vue (incl. Tracing) 44.38 kB -0.25% -107 B 🔽
@sentry/svelte 25.55 kB -0.45% -115 B 🔽
CDN Bundle 28.2 kB -0.27% -74 B 🔽
CDN Bundle (incl. Tracing) 43.39 kB -0.27% -117 B 🔽
CDN Bundle (incl. Logs, Metrics) 29.07 kB -0.26% -75 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) 44.26 kB -0.23% -99 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) 68.13 kB -0.12% -79 B 🔽
CDN Bundle (incl. Tracing, Replay) 80.24 kB -0.12% -90 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 81.16 kB -0.1% -76 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) 85.79 kB -0.1% -80 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 86.68 kB -0.11% -89 B 🔽
CDN Bundle - uncompressed 82.32 kB -0.37% -304 B 🔽
CDN Bundle (incl. Tracing) - uncompressed 128.25 kB -0.25% -315 B 🔽
CDN Bundle (incl. Logs, Metrics) - uncompressed 85.19 kB -0.36% -304 B 🔽
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 131.11 kB -0.24% -315 B 🔽
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 208.84 kB -0.14% -279 B 🔽
CDN Bundle (incl. Tracing, Replay) - uncompressed 245.12 kB -0.12% -290 B 🔽
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 247.97 kB -0.12% -290 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 258.03 kB -0.12% -290 B 🔽
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 260.88 kB -0.12% -290 B 🔽
@sentry/nextjs (client) 47.28 kB -0.19% -86 B 🔽
@sentry/sveltekit (client) 42.95 kB -0.28% -119 B 🔽
@sentry/node-core 56.28 kB -0.12% -62 B 🔽
@sentry/node 173.21 kB +0.04% +52 B 🔺
@sentry/node - without tracing 96.27 kB -0.08% -76 B 🔽
@sentry/aws-serverless 113.28 kB -0.06% -61 B 🔽

View base workflow run

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 19, 2026

node-overhead report 🧳

Note: This is a synthetic benchmark with a minimal express app and does not necessarily reflect the real-world performance impact in an application.

Scenario Requests/s % of Baseline Prev. Requests/s Change %
GET Baseline 11,139 - 11,324 -2%
GET With Sentry 1,793 16% 1,998 -10%
GET With Sentry (error only) 7,420 67% 7,342 +1%
POST Baseline 1,125 - 1,307 -14%
POST With Sentry 522 46% 660 -21%
POST With Sentry (error only) 997 89% 1,161 -14%
MYSQL Baseline 3,831 - 3,528 +9%
MYSQL With Sentry 455 12% 453 +0%
MYSQL With Sentry (error only) 3,079 80% 2,973 +4%

View base workflow run

This changes getEarliestTimestamp() to walk the list a single time,
instead of performing a full sort, as a sorted list is not needed, just
the smallest value.
@isaacs isaacs force-pushed the isaacs/chore-lint-warnings branch from 04129d0 to 7a3168e Compare March 19, 2026 19:07
@isaacs isaacs enabled auto-merge (rebase) March 19, 2026 19:41
@isaacs isaacs merged commit c167cf2 into develop Mar 19, 2026
459 of 461 checks passed
@isaacs isaacs deleted the isaacs/chore-lint-warnings branch March 19, 2026 19:52
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.

chore(lint): resolve oxlint warnings

2 participants