From 7feb38ffa1bcc1881d22e33cdd7bde8ef8d8e0bc Mon Sep 17 00:00:00 2001 From: Panagiotis Papadopoulos Date: Thu, 6 Mar 2025 23:21:47 +0100 Subject: [PATCH] chore(lint): fix no-unused-vars errors --- src/routes/api/image.ts | 2 +- src/routes/api/recent_changes.ts | 1 - src/routes/api/relation-map.ts | 2 +- src/routes/api/revisions.ts | 1 - src/routes/api/similar_notes.ts | 2 +- src/routes/api_docs.ts | 2 +- src/routes/custom.ts | 2 +- src/routes/error_handlers.ts | 2 +- 8 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/routes/api/image.ts b/src/routes/api/image.ts index d2d943486..d2f2b5632 100644 --- a/src/routes/api/image.ts +++ b/src/routes/api/image.ts @@ -82,7 +82,7 @@ function updateImage(req: Request) { const { noteId } = req.params; const { file } = req; - const note = becca.getNoteOrThrow(noteId); + const _note = becca.getNoteOrThrow(noteId); if (!file) { return { diff --git a/src/routes/api/recent_changes.ts b/src/routes/api/recent_changes.ts index 55a5ee9da..67b7436a0 100644 --- a/src/routes/api/recent_changes.ts +++ b/src/routes/api/recent_changes.ts @@ -5,7 +5,6 @@ import protectedSessionService from "../../services/protected_session.js"; import noteService from "../../services/notes.js"; import becca from "../../becca/becca.js"; import type { Request } from "express"; -import type { RevisionRow } from "../../becca/entities/rows.js"; interface RecentChangeRow { noteId: string; diff --git a/src/routes/api/relation-map.ts b/src/routes/api/relation-map.ts index 503bb36ef..2cf591b50 100644 --- a/src/routes/api/relation-map.ts +++ b/src/routes/api/relation-map.ts @@ -30,7 +30,7 @@ function getRelationMap(req: Request) { return resp; } - const questionMarks = noteIds.map((noteId) => "?").join(","); + const questionMarks = noteIds.map((_noteId) => "?").join(","); const relationMapNote = becca.getNoteOrThrow(relationMapNoteId); diff --git a/src/routes/api/revisions.ts b/src/routes/api/revisions.ts index 0e4cf1136..aeb6f32d2 100644 --- a/src/routes/api/revisions.ts +++ b/src/routes/api/revisions.ts @@ -1,7 +1,6 @@ "use strict"; import beccaService from "../../becca/becca_service.js"; -import revisionService from "../../services/revisions.js"; import utils from "../../services/utils.js"; import sql from "../../services/sql.js"; import cls from "../../services/cls.js"; diff --git a/src/routes/api/similar_notes.ts b/src/routes/api/similar_notes.ts index 930f53282..8cd82dc72 100644 --- a/src/routes/api/similar_notes.ts +++ b/src/routes/api/similar_notes.ts @@ -8,7 +8,7 @@ import becca from "../../becca/becca.js"; async function getSimilarNotes(req: Request) { const noteId = req.params.noteId; - const note = becca.getNoteOrThrow(noteId); + const _note = becca.getNoteOrThrow(noteId); return await similarityService.findSimilarNotes(noteId); } diff --git a/src/routes/api_docs.ts b/src/routes/api_docs.ts index 10d894056..df069a24f 100644 --- a/src/routes/api_docs.ts +++ b/src/routes/api_docs.ts @@ -1,4 +1,4 @@ -import type { Application, Router } from "express"; +import type { Application } from "express"; import swaggerUi from "swagger-ui-express"; import { readFile } from "fs/promises"; import { fileURLToPath } from "url"; diff --git a/src/routes/custom.ts b/src/routes/custom.ts index f2b961f80..d8b90de5c 100644 --- a/src/routes/custom.ts +++ b/src/routes/custom.ts @@ -68,7 +68,7 @@ function handleRequest(req: Request, res: Response) { function register(router: Router) { // explicitly no CSRF middleware since it's meant to allow integration from external services - router.all("/custom/:path*", (req: Request, res: Response, next) => { + router.all("/custom/:path*", (req: Request, res: Response, _next) => { cls.namespace.bindEmitter(req); cls.namespace.bindEmitter(res); diff --git a/src/routes/error_handlers.ts b/src/routes/error_handlers.ts index a73599e38..e773fcb22 100644 --- a/src/routes/error_handlers.ts +++ b/src/routes/error_handlers.ts @@ -22,7 +22,7 @@ function register(app: Application) { }); // error handler - app.use((err: any, req: Request, res: Response, next: NextFunction) => { + app.use((err: any, req: Request, res: Response, _next: NextFunction) => { if (err.status !== 404) { log.info(err); } else {