Skip to content

chore: remove typeSocket assertion helper#653

Merged
bliuchak merged 1 commit into
version-3.0from
fix/type-socket
Apr 29, 2026
Merged

chore: remove typeSocket assertion helper#653
bliuchak merged 1 commit into
version-3.0from
fix/type-socket

Conversation

@bliuchak

@bliuchak bliuchak commented Apr 29, 2026

Copy link
Copy Markdown
Contributor

This PR fixes linter warnings by removing typeSocket assertion helper. Instead, we're gonna cast the type.

Why: I don't want to add another linter suppression there. That's why I decided to remove this helper and just cast it in two places instead.

@bliuchak bliuchak added adhoc Ad-hoc unplanned task added during the sprint. medium priority Medium priority issues to be done in a couple of sprints. t-unblocking Issues with this label are in the ownership of the unblocking team. labels Apr 29, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Removes the typeSocket TypeScript assertion helper from count_target_bytes to eliminate lint/TS suppression comments, replacing it with direct type casts for the local “socket with extras” shape used to track byte stats.

Changes:

  • Deleted the empty typeSocket() assertion helper (and its @ts-expect-error / eslint suppression comments).
  • Updated countTargetBytes and getTargetStats to cast sockets to net.Socket & Extras locally.
  • Renamed parameters (sourcesourceSocket, socketrawSocket) to avoid identifier conflicts after introducing local cast variables.

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

@bliuchak bliuchak self-assigned this Apr 29, 2026
@bliuchak bliuchak merged commit 8701fa9 into version-3.0 Apr 29, 2026
7 checks passed
@bliuchak bliuchak deleted the fix/type-socket branch April 29, 2026 09:40
bliuchak added a commit that referenced this pull request May 5, 2026
* feat!: update minimal supported version of Node.js to v20 (#638)
* chore: remove typeSocket assertion helper (#653)
* feat!: migrate from CJS to ESM (#654)
* feat: upgrade typescript to v5 (#655)
* feat!: replace nodeify by async/await (#656)
* chore: format changelog markdown
* docs: add new version info into changelog
* chore: bump package version to a major one

Close #637
@bliuchak bliuchak added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label May 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. medium priority Medium priority issues to be done in a couple of sprints. t-unblocking Issues with this label are in the ownership of the unblocking team. validated Issues that are resolved and their solutions fulfill the acceptance criteria.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants