Skip to content

Build your personal knowledge base with Trilium Notes

chore(lint): fix no-unused-vars errors

Panagiotis Papadopoulos7feb38ffa1bc
diff --git a/src/routes/api/image.ts b/src/routes/api/image.ts
index d2d9434867..d2f2b5632d 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 55a5ee9dab..67b7436a05 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 503bb36ef4..2cf591b50c 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 0e4cf11368..aeb6f32d2c 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 930f53282d..8cd82dc722 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 10d8940562..df069a24f3 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 f2b961f80a..d8b90de5c2 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 a73599e38d..e773fcb228 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 {