From fc61945928ae1ac62d31be7fd3a2dbdae679060b Mon Sep 17 00:00:00 2001 From: Daniel Emery Date: Thu, 19 Dec 2024 13:50:37 +0100 Subject: [PATCH] Remove now-unecessary eslint ignore rules --- src/index.ts | 2 -- src/quiz/quiz.service.ts | 8 ++------ src/util/cache.ts | 1 - 3 files changed, 2 insertions(+), 9 deletions(-) diff --git a/src/index.ts b/src/index.ts index 9d18a85..6155eae 100644 --- a/src/index.ts +++ b/src/index.ts @@ -109,10 +109,8 @@ async function initialise() { const jwt = await authenticationService.verifyToken(sanitisedToken); - /* eslint-disable @typescript-eslint/no-explicit-any */ const email = (jwt as any)[`${config.CLIENT_URL}/email`] as string; const name = (jwt as any)[`${config.CLIENT_URL}/name`] as string | undefined; - /* eslint-enable @typescript-eslint/no-explicit-any */ const { roles, id } = await userService.loadUserDetailsAndUpdateIfNecessary(email, name); diff --git a/src/quiz/quiz.service.ts b/src/quiz/quiz.service.ts index 84f3784..dcd18b1 100644 --- a/src/quiz/quiz.service.ts +++ b/src/quiz/quiz.service.ts @@ -60,9 +60,7 @@ export class QuizService { const quiz = await this.#persistence.getQuizByIdWithResults({ id, }); - // TODO look into modifying the upstream https://eslint.org/docs/latest/rules/no-unused-vars#ignorerestsiblings linting rule - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { images, completions, uploadedByUser, uploadedByUserId, ...quizFieldsThatDoNotRequireTransform } = quiz; + const { images, completions, uploadedByUser, ...quizFieldsThatDoNotRequireTransform } = quiz; return { ...quizFieldsThatDoNotRequireTransform, completions: completions.map((entry) => this.#quizCompletionPersistenceToQuizCompletion(entry)), @@ -299,9 +297,7 @@ export class QuizService { })[]; }, ): Quiz { - // TODO modify linting tules to allow unused vars in destructuring - // eslint-disable-next-line @typescript-eslint/no-unused-vars - const { completions, uploadedByUser, uploadedByUserId, ...quizWithoutImageKey } = quiz; + const { completions, uploadedByUser, ...quizWithoutImageKey } = quiz; return { ...quizWithoutImageKey, myCompletions: completions.map((entry) => this.#quizCompletionPersistenceToQuizCompletion(entry)), diff --git a/src/util/cache.ts b/src/util/cache.ts index cce04fd..5fc4cc7 100644 --- a/src/util/cache.ts +++ b/src/util/cache.ts @@ -36,7 +36,6 @@ export interface Cache { * Will be replaced with a Redis implementation in the future. */ export class MemoryCache implements Cache { - // eslint-disable-next-line @typescript-eslint/no-explicit-any #values: Map = new Map(); getItem(key: string): Promise { const record = this.#values.get(key);