Skip to content

Commit d6cfd14

Browse files
committed
Make linter happy
1 parent d3b171d commit d6cfd14

File tree

3 files changed

+18
-13
lines changed

3 files changed

+18
-13
lines changed

packages/core/src/meshDevice.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -775,13 +775,14 @@ export class MeshDevice {
775775
},
776776
});
777777

778-
return this.sendRaw(toBinary(Protobuf.Mesh.ToRadioSchema, toRadio))
779-
.catch((e) => {
778+
return this.sendRaw(toBinary(Protobuf.Mesh.ToRadioSchema, toRadio)).catch(
779+
(e) => {
780780
if (this.deviceStatus === DeviceStatusEnum.DeviceDisconnected) {
781-
throw new Error('Device connection lost');
781+
throw new Error("Device connection lost");
782782
}
783783
throw e;
784-
});
784+
},
785+
);
785786
}
786787

787788
/**
@@ -810,8 +811,8 @@ export class MeshDevice {
810811
this._heartbeatIntervalId = setInterval(() => {
811812
this.heartbeat().catch((err) => {
812813
this.log.error(
813-
Emitter[Emitter.Ping],
814-
`⚠️ Unable to send heartbeat: ${err.message}`
814+
Emitter[Emitter.Ping],
815+
`⚠️ Unable to send heartbeat: ${err.message}`,
815816
);
816817
});
817818
}, interval);

packages/core/src/utils/queue.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,10 @@ export class Queue {
117117
await writer.write(item.data);
118118
item.sent = true;
119119
} catch (error) {
120-
if (error?.code === 'ECONNRESET' || error?.code === 'ERR_INVALID_STATE') {
120+
if (
121+
error?.code === "ECONNRESET" ||
122+
error?.code === "ERR_INVALID_STATE"
123+
) {
121124
writer.releaseLock();
122125
this.lock = false;
123126
throw error;

packages/transport-node/src/transport.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,11 @@ export class TransportNode implements Types.Transport {
2929
* @param timeout - TCP socket timeout in milliseconds (defaults to 60000).
3030
* @returns A promise that resolves with a connected TransportNode instance.
3131
*/
32-
public static create(hostname: string, port = 4403, timeout = 60000): Promise<TransportNode> {
32+
public static create(
33+
hostname: string,
34+
port = 4403,
35+
timeout = 60000,
36+
): Promise<TransportNode> {
3337
return new Promise((resolve, reject) => {
3438
const socket = new Socket();
3539

@@ -72,10 +76,7 @@ export class TransportNode implements Types.Transport {
7276
if (this.closingByUser) {
7377
return; // suppress close-derived disconnect in user flow
7478
}
75-
this.emitStatus(
76-
Types.DeviceStatusEnum.DeviceDisconnected,
77-
"socket-end",
78-
);
79+
this.emitStatus(Types.DeviceStatusEnum.DeviceDisconnected, "socket-end");
7980
this.socket?.removeAllListeners();
8081
this.socket?.destroy();
8182
});
@@ -207,7 +208,7 @@ export class TransportNode implements Types.Transport {
207208
data: { status: next, reason },
208209
});
209210
} catch (e) {
210-
console.error('Enqueue fail', e);
211+
console.error("Enqueue fail", e);
211212
}
212213
}
213214
}

0 commit comments

Comments
 (0)