Skip to content

Commit 351833c

Browse files
committed
Fix disabled linter warnings
1 parent 72e968a commit 351833c

File tree

3 files changed

+7
-12
lines changed

3 files changed

+7
-12
lines changed

packages/p2p-media-loader-core/src/declarations.d.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,6 @@ declare module "bittorrent-tracker" {
1616
): void;
1717

1818
start(): void;
19-
20-
complete(): void;
21-
22-
update(data?: object): void;
23-
2419
destroy(): void;
2520
}
2621

packages/p2p-media-loader-core/src/p2p/loader.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,8 @@ export class P2PLoader {
8989

9090
get connectedPeerCount() {
9191
let count = 0;
92-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
93-
for (const peer of this.trackerClient.peers()) count++;
92+
const iterator = this.trackerClient.peers();
93+
while (!iterator.next().done) count++;
9494
return count;
9595
}
9696

packages/p2p-media-loader-core/src/p2p/tracker-client.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,16 @@ export class P2PTrackerClient {
8282

8383
destroy() {
8484
this.client.destroy();
85+
8586
for (const { peer, potentialConnections } of this._peers.values()) {
8687
peer?.destroy();
8788
for (const connection of potentialConnections) {
8889
connection.destroy();
8990
}
9091
}
92+
9193
this._peers.clear();
92-
this.logger(`destroy client; stream: ${this.streamShortId}`);
94+
this.logger("destroy client; stream:", this.streamShortId);
9395
}
9496

9597
private onReceivePeerConnection: TrackerClientEvents["peer"] = (
@@ -141,17 +143,15 @@ export class P2PTrackerClient {
141143
private onTrackerClientWarning: TrackerClientEvents["warning"] = (
142144
warning,
143145
) => {
144-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
145-
this.logger(`tracker warning (${this.streamShortId}: ${warning})`);
146+
this.logger("tracker warning %s:", this.streamShortId, warning);
146147
this.eventTarget.getEventDispatcher("onTrackerWarning")({
147148
streamType: this.stream.type,
148149
warning,
149150
});
150151
};
151152

152153
private onTrackerClientError: TrackerClientEvents["error"] = (error) => {
153-
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
154-
this.logger(`tracker error (${this.streamShortId}: ${error})`);
154+
this.logger("tracker error in stream %s:", this.streamShortId, error);
155155
this.eventTarget.getEventDispatcher("onTrackerError")({
156156
streamType: this.stream.type,
157157
error,

0 commit comments

Comments
 (0)