mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-09-29 06:43:17 -05:00
Fix lint
This commit is contained in:
@@ -1,22 +1,22 @@
|
||||
import { ActionFunction, json, useLoaderData, useMatches } from "remix";
|
||||
import type { LinksFunction, LoaderFunction } from "remix";
|
||||
import { EliminationBracket } from "~/components/tournament/EliminationBracket";
|
||||
import styles from "~/styles/tournament-bracket.css";
|
||||
import { ActionFunction, json, useMatches } from "remix";
|
||||
import invariant from "tiny-invariant";
|
||||
import type { FindTournamentByNameForUrlI } from "~/services/tournament";
|
||||
import { bracketById, reportScore, undoLastScore } from "~/services/bracket";
|
||||
import type { BracketModified } from "~/services/bracket";
|
||||
import { useEvents, useUser } from "~/utils/hooks";
|
||||
import { BracketActions } from "~/components/tournament/BracketActions";
|
||||
import { z } from "zod";
|
||||
import { BracketActions } from "~/components/tournament/BracketActions";
|
||||
import { EliminationBracket } from "~/components/tournament/EliminationBracket";
|
||||
import { BEST_OF_OPTIONS, TOURNAMENT_TEAM_ROSTER_MIN_SIZE } from "~/constants";
|
||||
import { useBracketDataWithEvents } from "~/hooks/useBracketDataWithEvents";
|
||||
import type { BracketModified } from "~/services/bracket";
|
||||
import { bracketById, reportScore, undoLastScore } from "~/services/bracket";
|
||||
import type { FindTournamentByNameForUrlI } from "~/services/tournament";
|
||||
import styles from "~/styles/tournament-bracket.css";
|
||||
import {
|
||||
parseRequestFormData,
|
||||
requireEvents,
|
||||
requireUser,
|
||||
safeJSONParse,
|
||||
} from "~/utils";
|
||||
import { BEST_OF_OPTIONS, TOURNAMENT_TEAM_ROSTER_MIN_SIZE } from "~/constants";
|
||||
import { useBracketDataWithEvents } from "~/hooks/useBracketDataWithEvents";
|
||||
import { useUser } from "~/utils/hooks";
|
||||
|
||||
export const links: LinksFunction = () => {
|
||||
return [{ rel: "stylesheet", href: styles }];
|
||||
|
||||
@@ -259,16 +259,18 @@ export async function reportScore({
|
||||
reporterId: userId,
|
||||
winner: winnerTeam.order,
|
||||
});
|
||||
|
||||
const upperParticipant = match.participants.find(
|
||||
(p) => p.order === "UPPER"
|
||||
)!;
|
||||
);
|
||||
const lowerParticipant = match.participants.find(
|
||||
(p) => p.order === "LOWER"
|
||||
)!;
|
||||
);
|
||||
|
||||
return [
|
||||
match.position,
|
||||
upperParticipant.team.name,
|
||||
lowerParticipant.team.name,
|
||||
upperParticipant?.team.name ?? null,
|
||||
lowerParticipant?.team.name ?? null,
|
||||
newScore[0],
|
||||
newScore[1],
|
||||
];
|
||||
|
||||
@@ -31,6 +31,7 @@ export const useEvents = (
|
||||
});
|
||||
|
||||
source.addEventListener("message", (e) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
||||
handleEvent(JSON.parse(e.data));
|
||||
});
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import { v4 as uuidv4 } from "uuid";
|
||||
|
||||
export type BracketData = [
|
||||
matchNumber: number,
|
||||
teamUpper: string,
|
||||
teamLower: string,
|
||||
teamUpper: string | null,
|
||||
teamLower: string | null,
|
||||
scoreUpper: number,
|
||||
scoreLower: number
|
||||
];
|
||||
@@ -70,7 +70,7 @@ const sendEvent = ({
|
||||
data,
|
||||
}: {
|
||||
res: Response;
|
||||
data: Array<string | number>;
|
||||
data: Array<string | number | null>;
|
||||
}) => {
|
||||
res.write(`data: ${JSON.stringify(data)}\n\n`);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user