diff --git a/web/package.json b/web/package.json index d58e5a4c..2b77243b 100644 --- a/web/package.json +++ b/web/package.json @@ -6,6 +6,7 @@ "scripts": { "dev": "vite", "build": "vite build", + "tsc": "tsc", "tsc:build": "tsc && vite build", "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "preview": "vite preview", diff --git a/web/src/components/modals/GameTeamApplyModal.tsx b/web/src/components/modals/GameTeamApplyModal.tsx index 5105b67a..22d9bbc9 100644 --- a/web/src/components/modals/GameTeamApplyModal.tsx +++ b/web/src/components/modals/GameTeamApplyModal.tsx @@ -9,10 +9,7 @@ import { Group, Modal, ModalProps, - Pagination, Stack, - TextInput, - ThemeIcon, Text, } from "@mantine/core"; import { useState, useEffect } from "react"; diff --git a/web/src/components/modals/TeamCreateModal.tsx b/web/src/components/modals/TeamCreateModal.tsx index a135e6a6..784720a2 100644 --- a/web/src/components/modals/TeamCreateModal.tsx +++ b/web/src/components/modals/TeamCreateModal.tsx @@ -3,7 +3,6 @@ import { Flex, Modal, ModalProps, - ThemeIcon, Text, Divider, TextInput, diff --git a/web/src/components/modals/TeamEditModal.tsx b/web/src/components/modals/TeamEditModal.tsx index 8228c116..643f67c9 100644 --- a/web/src/components/modals/TeamEditModal.tsx +++ b/web/src/components/modals/TeamEditModal.tsx @@ -10,7 +10,6 @@ import { Flex, Modal, ModalProps, - ThemeIcon, Text, Divider, Box, diff --git a/web/src/components/modals/TeamJoinModal.tsx b/web/src/components/modals/TeamJoinModal.tsx index 6fdf5609..be2a15c5 100644 --- a/web/src/components/modals/TeamJoinModal.tsx +++ b/web/src/components/modals/TeamJoinModal.tsx @@ -10,7 +10,6 @@ import { Flex, Modal, ModalProps, - ThemeIcon, Text, TextInput, Button, @@ -52,7 +51,7 @@ export default function TeamJoinModal(props: TeamJoinModalProps) { message: "加入团队成功", }); }) - .catch((e) => { + .catch((_) => { showErrNotification({ message: "邀请码无效或团队已被锁定", }); diff --git a/web/src/components/modals/admin/TeamCreateModal.tsx b/web/src/components/modals/admin/TeamCreateModal.tsx index 88af1ef7..f7b9f37b 100644 --- a/web/src/components/modals/admin/TeamCreateModal.tsx +++ b/web/src/components/modals/admin/TeamCreateModal.tsx @@ -3,7 +3,6 @@ import { Flex, Modal, ModalProps, - ThemeIcon, Text, Divider, TextInput, @@ -12,7 +11,6 @@ import { Button, Box, Input, - Avatar, Group, } from "@mantine/core"; import MDIcon from "@/components/ui/MDIcon"; diff --git a/web/src/components/modals/admin/TeamEditModal.tsx b/web/src/components/modals/admin/TeamEditModal.tsx index af4b1a44..950e17a2 100644 --- a/web/src/components/modals/admin/TeamEditModal.tsx +++ b/web/src/components/modals/admin/TeamEditModal.tsx @@ -9,7 +9,6 @@ import { Flex, Modal, ModalProps, - ThemeIcon, Text, Divider, Box, diff --git a/web/src/components/modals/admin/TeamSelectModal.tsx b/web/src/components/modals/admin/TeamSelectModal.tsx index 99bc6c20..1cfec502 100644 --- a/web/src/components/modals/admin/TeamSelectModal.tsx +++ b/web/src/components/modals/admin/TeamSelectModal.tsx @@ -8,7 +8,6 @@ import { Modal, ModalProps, TextInput, - ThemeIcon, Text, Stack, Avatar, diff --git a/web/src/components/modals/admin/UserCreateModal.tsx b/web/src/components/modals/admin/UserCreateModal.tsx index 6305850f..0f953070 100644 --- a/web/src/components/modals/admin/UserCreateModal.tsx +++ b/web/src/components/modals/admin/UserCreateModal.tsx @@ -3,7 +3,6 @@ import { Flex, Modal, ModalProps, - ThemeIcon, Text, Divider, TextInput, diff --git a/web/src/components/modals/admin/UserEditModal.tsx b/web/src/components/modals/admin/UserEditModal.tsx index c158b0e0..adfdc86a 100644 --- a/web/src/components/modals/admin/UserEditModal.tsx +++ b/web/src/components/modals/admin/UserEditModal.tsx @@ -3,7 +3,6 @@ import { Flex, Modal, ModalProps, - ThemeIcon, Text, Divider, TextInput, diff --git a/web/src/components/modals/admin/UserSelectModal.tsx b/web/src/components/modals/admin/UserSelectModal.tsx index 5f3d60ea..ae3552ba 100644 --- a/web/src/components/modals/admin/UserSelectModal.tsx +++ b/web/src/components/modals/admin/UserSelectModal.tsx @@ -8,7 +8,6 @@ import { Modal, ModalProps, TextInput, - ThemeIcon, Text, Stack, Avatar, diff --git a/web/src/components/widgets/GameNoticeArea.tsx b/web/src/components/widgets/GameNoticeArea.tsx index 768d17f2..ce645e44 100644 --- a/web/src/components/widgets/GameNoticeArea.tsx +++ b/web/src/components/widgets/GameNoticeArea.tsx @@ -1,6 +1,6 @@ import { useGameApi } from "@/api/game"; import { Notice } from "@/types/notice"; -import { Box, Flex, ScrollArea, ThemeIcon } from "@mantine/core"; +import { Box, Flex, ScrollArea } from "@mantine/core"; import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import MDIcon from "@/components/ui/MDIcon"; diff --git a/web/src/components/widgets/TeamCard.tsx b/web/src/components/widgets/TeamCard.tsx index f5d53067..aedfcb2e 100644 --- a/web/src/components/widgets/TeamCard.tsx +++ b/web/src/components/widgets/TeamCard.tsx @@ -4,7 +4,6 @@ import { Box, Card, Flex, - ThemeIcon, alpha, Text, Stack, diff --git a/web/src/components/widgets/admin/ChallengeFlagAccordion.tsx b/web/src/components/widgets/admin/ChallengeFlagAccordion.tsx index b82718ec..ced5ce8d 100644 --- a/web/src/components/widgets/admin/ChallengeFlagAccordion.tsx +++ b/web/src/components/widgets/admin/ChallengeFlagAccordion.tsx @@ -17,7 +17,6 @@ import { Switch, Text, TextInput, - ThemeIcon, Tooltip, } from "@mantine/core"; import { useForm } from "@mantine/form"; @@ -32,7 +31,7 @@ interface ChallengeFlagAccordionProps { export default function ChallengeFlagAccordion( props: ChallengeFlagAccordionProps ) { - const { flag, setRefresh, ...otherProps } = props; + const { flag, setRefresh } = props; const challengeApi = useChallengeApi(); const form = useForm({ diff --git a/web/src/components/widgets/admin/GameChallengeAccordion.tsx b/web/src/components/widgets/admin/GameChallengeAccordion.tsx index e30ceb5e..d32b17bc 100644 --- a/web/src/components/widgets/admin/GameChallengeAccordion.tsx +++ b/web/src/components/widgets/admin/GameChallengeAccordion.tsx @@ -7,13 +7,11 @@ import { Flex, Group, Switch, - ThemeIcon, Tooltip, ActionIcon, Text, NumberInput, Button, - Stack, Badge, Center, Divider, diff --git a/web/src/pages/[...all].tsx b/web/src/pages/[...all].tsx index 2c5cb991..320bea06 100644 --- a/web/src/pages/[...all].tsx +++ b/web/src/pages/[...all].tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from "react"; +import { useEffect } from "react"; import { useConfigStore } from "@/stores/config"; import { Box, Text } from "@mantine/core"; diff --git a/web/src/pages/admin/challenges/[id]/flags.tsx b/web/src/pages/admin/challenges/[id]/flags.tsx index 66d0ab49..ba81c6b3 100644 --- a/web/src/pages/admin/challenges/[id]/flags.tsx +++ b/web/src/pages/admin/challenges/[id]/flags.tsx @@ -6,11 +6,9 @@ import ChallengeFlagAccordion from "@/components/widgets/admin/ChallengeFlagAcco import { Challenge } from "@/types/challenge"; import { Accordion, - Button, Flex, Group, Stack, - ThemeIcon, Text, Divider, ActionIcon, diff --git a/web/src/pages/admin/challenges/[id]/images.tsx b/web/src/pages/admin/challenges/[id]/images.tsx index 0ace8935..67d2e713 100644 --- a/web/src/pages/admin/challenges/[id]/images.tsx +++ b/web/src/pages/admin/challenges/[id]/images.tsx @@ -16,7 +16,6 @@ import { Stack, Text, TextInput, - ThemeIcon, Tooltip, } from "@mantine/core"; import { useForm } from "@mantine/form"; diff --git a/web/src/pages/admin/challenges/[id]/index.tsx b/web/src/pages/admin/challenges/[id]/index.tsx index 718bb5b7..c95a217d 100644 --- a/web/src/pages/admin/challenges/[id]/index.tsx +++ b/web/src/pages/admin/challenges/[id]/index.tsx @@ -23,7 +23,6 @@ import { Switch, TextInput, Textarea, - ThemeIcon, Tooltip, } from "@mantine/core"; import { useForm, zodResolver } from "@mantine/form"; diff --git a/web/src/pages/admin/challenges/[id]/submissions.tsx b/web/src/pages/admin/challenges/[id]/submissions.tsx index 580c4206..e86d9803 100644 --- a/web/src/pages/admin/challenges/[id]/submissions.tsx +++ b/web/src/pages/admin/challenges/[id]/submissions.tsx @@ -1,17 +1,13 @@ import { useChallengeApi } from "@/api/challenge"; -import { useGameApi } from "@/api/game"; import { useSubmissionApi } from "@/api/submission"; import withChallengeEdit from "@/components/layouts/admin/withChallengeEdit"; -import withGameEdit from "@/components/layouts/admin/withGameEdit"; import MDIcon from "@/components/ui/MDIcon"; import { Challenge } from "@/types/challenge"; -import { Game } from "@/types/game"; import { Submission } from "@/types/submission"; import { Divider, Group, Stack, - ThemeIcon, Text, Table, Pagination, @@ -35,7 +31,7 @@ function Page() { const [submissions, setSubmissions] = useState>([]); const [total, setTotal] = useState(0); - const [rowsPerPage, setRowsPerPage] = useState(10); + const [rowsPerPage, _] = useState(10); const [page, setPage] = useState(1); const [loading, setLoading] = useState(false); diff --git a/web/src/pages/admin/games/[id]/challenges.tsx b/web/src/pages/admin/games/[id]/challenges.tsx index e59ff6d2..f1c2d528 100644 --- a/web/src/pages/admin/games/[id]/challenges.tsx +++ b/web/src/pages/admin/games/[id]/challenges.tsx @@ -14,7 +14,6 @@ import { LoadingOverlay, Stack, Text, - ThemeIcon, Tooltip, } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; diff --git a/web/src/pages/admin/games/[id]/index.tsx b/web/src/pages/admin/games/[id]/index.tsx index 5d001731..befd88bd 100644 --- a/web/src/pages/admin/games/[id]/index.tsx +++ b/web/src/pages/admin/games/[id]/index.tsx @@ -21,7 +21,6 @@ import { Button, Group, Divider, - ThemeIcon, } from "@mantine/core"; import { DateTimePicker } from "@mantine/dates"; import { Dropzone } from "@mantine/dropzone"; diff --git a/web/src/pages/admin/games/[id]/notices.tsx b/web/src/pages/admin/games/[id]/notices.tsx index fb065ff1..f38916b2 100644 --- a/web/src/pages/admin/games/[id]/notices.tsx +++ b/web/src/pages/admin/games/[id]/notices.tsx @@ -11,7 +11,6 @@ import { Flex, Group, Stack, - ThemeIcon, Tooltip, Text, Badge, @@ -33,7 +32,7 @@ function Page() { const [game, setGame] = useState(); const [refresh, setRefresh] = useState(0); const [notices, setNotices] = useState>(); - const [rowsPerPage, setRowsPerPage] = useState(10); + const [rowsPerPage, _] = useState(10); const [page, setPage] = useState(1); const [displayedNotices, setDisplayedNotices] = useState>([]); diff --git a/web/src/pages/admin/games/[id]/submissions.tsx b/web/src/pages/admin/games/[id]/submissions.tsx index a703cd84..dca12944 100644 --- a/web/src/pages/admin/games/[id]/submissions.tsx +++ b/web/src/pages/admin/games/[id]/submissions.tsx @@ -9,7 +9,6 @@ import { Divider, Group, Stack, - ThemeIcon, Text, Table, Pagination, @@ -34,7 +33,7 @@ function Page() { const [submissions, setSubmissions] = useState>([]); const [total, setTotal] = useState(0); - const [rowsPerPage, setRowsPerPage] = useState(10); + const [rowsPerPage, _] = useState(10); const [page, setPage] = useState(1); const [loading, setLoading] = useState(false); diff --git a/web/src/pages/admin/games/[id]/teams.tsx b/web/src/pages/admin/games/[id]/teams.tsx index 2bfa5c39..1df269b7 100644 --- a/web/src/pages/admin/games/[id]/teams.tsx +++ b/web/src/pages/admin/games/[id]/teams.tsx @@ -4,7 +4,6 @@ import GameTeamCreateModal from "@/components/modals/admin/GameTeamCreateModal"; import MDIcon from "@/components/ui/MDIcon"; import { Game } from "@/types/game"; import { GameTeam } from "@/types/game_team"; -import { Team } from "@/types/team"; import { showSuccessNotification } from "@/utils/notification"; import { ActionIcon, @@ -12,13 +11,9 @@ import { Flex, Group, Stack, - ThemeIcon, Tooltip, Text, - Accordion, - Center, Avatar, - Box, Badge, Switch, Pagination, @@ -39,7 +34,7 @@ function Page() { const [game, setGame] = useState(); const [refresh, setRefresh] = useState(0); const [gameTeams, setGameTeams] = useState>([]); - const [rowsPerPage, setRowsPerPage] = useState(10); + const [rowsPerPage, _] = useState(10); const [page, setPage] = useState(1); const [displayedGameTeams, setDisplayedGameTeams] = useState< diff --git a/web/src/pages/admin/games/index.tsx b/web/src/pages/admin/games/index.tsx index d41dc58e..707fb75b 100644 --- a/web/src/pages/admin/games/index.tsx +++ b/web/src/pages/admin/games/index.tsx @@ -8,10 +8,6 @@ import { } from "@/utils/notification"; import { ActionIcon, - Avatar, - BackgroundImage, - Image, - Divider, Flex, Group, Pagination, @@ -25,6 +21,8 @@ import { Badge, Switch, Tooltip, + Image, + Divider, } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { modals } from "@mantine/modals"; diff --git a/web/src/pages/admin/users/index.tsx b/web/src/pages/admin/users/index.tsx index 9f755428..29ae4550 100644 --- a/web/src/pages/admin/users/index.tsx +++ b/web/src/pages/admin/users/index.tsx @@ -22,7 +22,6 @@ import { Table, Text, TextInput, - ThemeIcon, } from "@mantine/core"; import { useDisclosure } from "@mantine/hooks"; import { modals } from "@mantine/modals"; @@ -69,7 +68,7 @@ export default function Page() { .deleteUser({ id: Number(user?.id), }) - .then((res) => { + .then((_) => { showSuccessNotification({ message: `用户 ${user?.nickname} 已被删除`, }); diff --git a/web/src/pages/games/[id]/index.tsx b/web/src/pages/games/[id]/index.tsx index e6ef9a9d..895b5416 100644 --- a/web/src/pages/games/[id]/index.tsx +++ b/web/src/pages/games/[id]/index.tsx @@ -12,7 +12,6 @@ import { Stack, Group, Badge, - ThemeIcon, Progress, Button, } from "@mantine/core"; diff --git a/web/src/pages/games/[id]/scoreboard.tsx b/web/src/pages/games/[id]/scoreboard.tsx index 4e519fcc..26fa0c3b 100644 --- a/web/src/pages/games/[id]/scoreboard.tsx +++ b/web/src/pages/games/[id]/scoreboard.tsx @@ -3,13 +3,11 @@ import { useSubmissionApi } from "@/api/submission"; import { Game } from "@/types/game"; import { Submission } from "@/types/submission"; import { - Box, Flex, Stack, useMantineColorScheme, useMantineTheme, Text, - Button, Group, LoadingOverlay, Table, diff --git a/web/src/pages/games/index.tsx b/web/src/pages/games/index.tsx index a296c412..56a61d76 100644 --- a/web/src/pages/games/index.tsx +++ b/web/src/pages/games/index.tsx @@ -4,7 +4,6 @@ import GameCard from "@/components/widgets/GameCard"; import { useConfigStore } from "@/stores/config"; import { Game } from "@/types/game"; import { - Box, Button, Flex, Pagination, diff --git a/web/src/pages/profile.tsx b/web/src/pages/profile.tsx index 5914c645..52392700 100644 --- a/web/src/pages/profile.tsx +++ b/web/src/pages/profile.tsx @@ -13,11 +13,9 @@ import { Center, Divider, Flex, - Select, Stack, Text, TextInput, - ThemeIcon, Image, } from "@mantine/core"; import { Dropzone } from "@mantine/dropzone"; diff --git a/web/src/utils/axios.ts b/web/src/utils/axios.ts index 20e17305..358341d2 100644 --- a/web/src/utils/axios.ts +++ b/web/src/utils/axios.ts @@ -2,13 +2,7 @@ import axios from "axios"; import { useAuthStore } from "@/stores/auth"; import { useMemo } from "react"; import { useNavigate } from "react-router"; -import { showNotification } from "@mantine/notifications"; -import { - showErrNotification, - showInfoNotification, - showSuccessNotification, - showWarnNotification, -} from "./notification"; +import { showInfoNotification } from "./notification"; export const useApi = () => { return useMemo(() => {