From 9270d48e9ce12a16f5be77dd9025f797bd03765d Mon Sep 17 00:00:00 2001 From: Jan Romann Date: Wed, 20 Oct 2021 17:51:58 +0200 Subject: [PATCH] stlye(coap): let eslint ignore explicit anys This is a temporary workaround until #538 is ready. --- packages/binding-coap/src/coap-client.ts | 7 +++++++ packages/binding-coap/src/coap-server.ts | 2 ++ 2 files changed, 9 insertions(+) diff --git a/packages/binding-coap/src/coap-client.ts b/packages/binding-coap/src/coap-client.ts index b3dc77d97..629b19527 100644 --- a/packages/binding-coap/src/coap-client.ts +++ b/packages/binding-coap/src/coap-client.ts @@ -40,7 +40,9 @@ import coap = require("coap"); export default class CoapClient implements ProtocolClient { // FIXME coap Agent closes socket when no messages in flight -> new socket with every request + // eslint-disable-next-line @typescript-eslint/no-explicit-any private agent: any; + // eslint-disable-next-line @typescript-eslint/no-explicit-any private readonly agentOptions: any; constructor(server?: CoapServer) { @@ -60,6 +62,7 @@ export default class CoapClient implements ProtocolClient { const req = await this.generateRequest(form, "GET"); console.debug("[binding-coap]", `CoapClient sending ${req.statusCode} to ${form.href}`); return new Promise((resolve, reject) => { + // eslint-disable-next-line @typescript-eslint/no-explicit-any req.on("response", (res: any) => { console.debug("[binding-coap]", `CoapClient received ${res.code} from ${form.href}`); console.debug("[binding-coap]", `CoapClient received Content-Format: ${res.headers["Content-Format"]}`); @@ -85,6 +88,7 @@ export default class CoapClient implements ProtocolClient { console.debug("[binding-coap]", `CoapClient sending ${req.statusCode} to ${form.href}`); + // eslint-disable-next-line @typescript-eslint/no-explicit-any req.on("response", (res: any) => { console.debug("[binding-coap]", `CoapClient received ${res.code} from ${form.href}`); console.debug("[binding-coap]", `CoapClient received headers: ${JSON.stringify(res.headers)}`); @@ -130,6 +134,7 @@ export default class CoapClient implements ProtocolClient { console.debug("[binding-coap]", `CoapClient sending ${req.statusCode} to ${form.href}`); + // eslint-disable-next-line @typescript-eslint/no-explicit-any req.on("response", (res: any) => { console.debug("[binding-coap]", `CoapClient received ${res.code} from ${form.href}`); console.debug("[binding-coap]", `CoapClient received headers: ${JSON.stringify(res.headers)}`); @@ -151,6 +156,7 @@ export default class CoapClient implements ProtocolClient { console.debug("[binding-coap]", `CoapClient sending ${req.statusCode} to ${form.href}`); + // eslint-disable-next-line @typescript-eslint/no-explicit-any req.on("response", (res: any) => { console.debug("[binding-coap]", `CoapClient received ${res.code} from ${form.href}`); console.debug("[binding-coap]", `CoapClient received Content-Format: ${res.headers["Content-Format"]}`); @@ -234,6 +240,7 @@ export default class CoapClient implements ProtocolClient { return defaultMethod; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private generateRequest(form: CoapForm, defaultMethod: CoapMethodName, observable = false): any { const options: CoapRequestConfig = this.uriToOptions(form.href); diff --git a/packages/binding-coap/src/coap-server.ts b/packages/binding-coap/src/coap-server.ts index 25b69cf88..2f2fc4e4d 100644 --- a/packages/binding-coap/src/coap-server.ts +++ b/packages/binding-coap/src/coap-server.ts @@ -33,6 +33,7 @@ export default class CoapServer implements ProtocolServer { private readonly port: number = 5683; private readonly address?: string = undefined; + // eslint-disable-next-line @typescript-eslint/no-explicit-any private readonly server: any = coap.createServer((req: any, res: any) => { this.handleRequest(req, res); }); @@ -197,6 +198,7 @@ export default class CoapServer implements ProtocolServer { }); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private handleRequest(req: any, res: any) { console.debug( "[binding-coap]",