From b56229e58b6c0d500854b749f671481da943f243 Mon Sep 17 00:00:00 2001 From: Liam Date: Mon, 30 Sep 2024 07:20:58 +0100 Subject: [PATCH] eslint --- src/app/(pages)/api/player/history/route.ts | 3 +-- src/common/schema/player-schema.ts | 2 +- src/hooks/use-is-mobile.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/app/(pages)/api/player/history/route.ts b/src/app/(pages)/api/player/history/route.ts index 371a46d..186e1f0 100644 --- a/src/app/(pages)/api/player/history/route.ts +++ b/src/app/(pages)/api/player/history/route.ts @@ -1,8 +1,7 @@ import { NextRequest, NextResponse } from "next/server"; import { connectMongo } from "@/common/mongo"; import { IPlayer, PlayerModel } from "@/common/schema/player-schema"; -import { PlayerHistory } from "@/common/player/player-history"; -import { seedPlayerHistory, sortPlayerHistory } from "@/common/player-utils"; +import { seedPlayerHistory } from "@/common/player-utils"; import { scoresaberService } from "@/common/service/impl/scoresaber"; export async function GET(request: NextRequest) { diff --git a/src/common/schema/player-schema.ts b/src/common/schema/player-schema.ts index e81ad35..bd149c8 100644 --- a/src/common/schema/player-schema.ts +++ b/src/common/schema/player-schema.ts @@ -108,7 +108,7 @@ PlayerSchema.methods.getHistoryPrevious = function (amount: number): { const toReturn: { [key: string]: PlayerHistory } = {}; const history = sortPlayerHistory(this.getStatisticHistory()); - for (let [date, stat] of history) { + for (const [date, stat] of history) { const parsedDate = new Date(date); if (getDaysAgo(parsedDate) + 1 <= amount) { toReturn[date] = stat; diff --git a/src/hooks/use-is-mobile.ts b/src/hooks/use-is-mobile.ts index d2b12ee..1a65a74 100644 --- a/src/hooks/use-is-mobile.ts +++ b/src/hooks/use-is-mobile.ts @@ -1,4 +1,4 @@ -import { useState, useEffect } from "react"; +import { useEffect, useState } from "react"; export function useIsMobile() { const [isMobile, setIsMobile] = useState(false);