Skip to content

Commit 8dc6ed8

Browse files
refactor: removing unused variables (#1435)
* refactor: removing unused variables * refactor: fix missing unused variable
1 parent fc85ce8 commit 8dc6ed8

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

eslint.config.mjs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ export default defineConfig([
9494
// *************** Code style and best practices ***************
9595
"unused-imports/no-unused-imports": "error",
9696
"unused-imports/no-unused-vars": [
97-
"off", // // https://github.com/eclipse-thingweb/node-wot/issues/1430
97+
"error",
9898
{
9999
args: "none",
100100
varsIgnorePattern: "Test",

packages/binding-http/src/routes/action.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default async function actionRoute(
4848
let contentType: string = Array.isArray(contentTypeHeader) ? contentTypeHeader[0] : contentTypeHeader;
4949
try {
5050
contentType = validOrDefaultRequestContentType(req, res, contentType);
51-
} catch (error) {
51+
} catch {
5252
warn(
5353
`HttpServer received unsupported Content-Type from ${Helpers.toUriLiteral(req.socket.remoteAddress)}:${
5454
req.socket.remotePort

packages/binding-http/src/routes/property.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ export default async function propertyRoute(
4848
let contentType: string = Array.isArray(contentTypeHeader) ? contentTypeHeader[0] : contentTypeHeader;
4949
try {
5050
contentType = validOrDefaultRequestContentType(req, res, contentType);
51-
} catch (error) {
51+
} catch {
5252
warn(
5353
`HttpServer received unsupported Content-Type from ${Helpers.toUriLiteral(req.socket.remoteAddress)}:${
5454
req.socket.remotePort

packages/binding-http/test/http-client-test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ class TestHttpServer implements ProtocolServer {
176176
{ type: ContentSerdes.DEFAULT, body: Buffer.concat(body) },
177177
this.testVector.schema ?? { type: "string" }
178178
);
179-
} catch (err) {
179+
} catch {
180180
throw new Error("Cannot deserialize client payload");
181181
}
182182
expect(value).to.equal(this.testVector?.payload);

packages/binding-http/test/oauth-token-validation-tests.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,7 @@ describe("OAuth2.0 Validator tests", () => {
265265
try {
266266
await this.validator.validate(req as http.IncomingMessage, [], /.*/g);
267267
assert(false, "method did not throw");
268-
} catch (error) {
268+
} catch {
269269
assert(true);
270270
}
271271
}
@@ -287,7 +287,7 @@ describe("OAuth2.0 Validator tests", () => {
287287
try {
288288
await this.validator.validate(req as http.IncomingMessage, [], /.*/g);
289289
assert(false, "method did not throw");
290-
} catch (error) {
290+
} catch {
291291
assert(true);
292292
}
293293
}
@@ -309,7 +309,7 @@ describe("OAuth2.0 Validator tests", () => {
309309
try {
310310
await this.validator.validate(req as http.IncomingMessage, [], /.*/g);
311311
assert(false, "method did not throw");
312-
} catch (error) {
312+
} catch {
313313
assert(true);
314314
}
315315
}
@@ -331,7 +331,7 @@ describe("OAuth2.0 Validator tests", () => {
331331
try {
332332
await this.validator.validate(req as http.IncomingMessage, [], /.*/g);
333333
assert(false, "method did not throw");
334-
} catch (error) {
334+
} catch {
335335
assert(true);
336336
}
337337
}

packages/core/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ export default class Helpers implements Resolver {
211211
public static async parseInteractionOutput(response: WoT.InteractionOutput): Promise<DataSchemaValue> {
212212
try {
213213
return await response.value();
214-
} catch (err) {
214+
} catch {
215215
// TODO if response.value() fails, try low-level stream read
216216
error("parseInteractionOutput low-level stream not implemented");
217217
throw new Error("parseInteractionOutput low-level stream not implemented");

0 commit comments

Comments
 (0)