Skip to content

Commit

Permalink
stlye(coap): let eslint ignore explicit anys
Browse files Browse the repository at this point in the history
This is a temporary workaround until #538
is ready.
  • Loading branch information
JKRhb committed Oct 20, 2021
1 parent 6341238 commit 9270d48
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/binding-coap/src/coap-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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<Content>((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"]}`);
Expand All @@ -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)}`);
Expand Down Expand Up @@ -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)}`);
Expand All @@ -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"]}`);
Expand Down Expand Up @@ -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);

Expand Down
2 changes: 2 additions & 0 deletions packages/binding-coap/src/coap-server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
Expand Down Expand Up @@ -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]",
Expand Down

0 comments on commit 9270d48

Please sign in to comment.