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 23, 2024
1 parent 5f3804a commit 08b832a
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 11 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
2 changes: 0 additions & 2 deletions src/quiz/quiz.service.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@ describe('quiz', () => {
type: 'SHARK',
date: new Date('2023-01-01'),
uploadedAt: new Date('2023-01-02'),
uploadedByUserId: 'fake-user-id',
completions: [],
uploadedByUser: {
id: 'fake-user-id',
Expand All @@ -63,7 +62,6 @@ describe('quiz', () => {
type: 'BRAINWAVES',
date: new Date('2023-02-01'),
uploadedAt: new Date('2023-03-02'),
uploadedByUserId: 'fake-user-id',
completions: [
{
completedAt: new Date('2023-03-10'),
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 08b832a

Please sign in to comment.