Skip to content

Commit

Permalink
Remove now-unecessary eslint ignore rules
Browse files Browse the repository at this point in the history
  • Loading branch information
danielemery committed Dec 19, 2024
1 parent bcae93b commit fc61945
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 0 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down
8 changes: 2 additions & 6 deletions src/quiz/quiz.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)),
Expand Down Expand Up @@ -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)),
Expand Down
1 change: 0 additions & 1 deletion src/util/cache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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<string, { value: any; expiresAt?: Date }> = new Map();
getItem<T>(key: string): Promise<T | undefined> {
const record = this.#values.get(key);
Expand Down

0 comments on commit fc61945

Please sign in to comment.