refactor(global): import alias @

This commit is contained in:
kyuuseiryuu 2026-03-26 15:54:42 +09:00
parent 3a7525ae8d
commit 21ea49f7c7
29 changed files with 71 additions and 68 deletions

View File

@ -2,7 +2,7 @@ import { HeartOutlined, ScheduleOutlined, SearchOutlined, UserOutlined } from "@
import { Button, Flex } from "antd";
import { useNavigate } from "react-router";
import styled from "styled-components";
import { isRunningStandalone } from "../utils/front";
import { isRunningStandalone } from "@/utils/front";
const StyledContainer = styled.div`
position: fixed;

View File

@ -1,12 +1,12 @@
import type { BasePlayer } from "../types";
import type { BasePlayer } from "@/types";
import { useCallback, useEffect, useMemo, useState } from "react";
import { calculate, getRoundTable } from "../utils/common";
import { calculate, getRoundTable } from "@/utils/common";
import { Button, Card, Divider, Flex, Table, Modal, Typography, Input } from "antd";
import styled from "styled-components";
import { cloneDeep } from "lodash";
import { ClearOutlined, EditOutlined, ShareAltOutlined } from "@ant-design/icons";
import { useLocation } from "react-router";
import { MATCH_RESULT_MAP_KEY } from "../utils/constants";
import { MATCH_RESULT_MAP_KEY } from "@/utils/constants";
const StyledContainer = styled(Flex)`
min-width: 300px;

View File

@ -1,5 +1,5 @@
import { useRequest } from "ahooks";
import { useAuthHeaders } from "../hooks/useAuthHeaders";
import { useAuthHeaders } from "@/hooks/useAuthHeaders";
import { Alert, App, Button, Drawer, Flex, Form, Input, Skeleton, Space, Spin, Typography } from "antd";
import { ExportOutlined, LinkOutlined } from "@ant-design/icons";
import { useCallback, useState } from "react";

View File

@ -1,7 +1,7 @@
import { Cascader } from "antd";
import { useMemo } from "react";
const provinceCityConfig = require('../private/city.json');
const provinceCityConfig = require('@/private/city.json');
interface Props {
onChange?: (province?: string, city?: string) => void;

View File

@ -1,5 +1,5 @@
import { Button, Divider, Empty, Flex, Pagination, Skeleton, Space, Switch, Typography } from "antd";
import type { IEventInfo } from "../types";
import type { IEventInfo } from "@/types";
import { useCallback, useEffect, useMemo, useState } from "react";
import { EventCard } from "./EventCard";
import { useRequest } from "ahooks";

View File

@ -1,9 +1,9 @@
import { useRequest } from "ahooks";
import { Avatar, Button, Flex, Input, Radio, Space, Table } from "antd";
import { useCallback, useRef, useState } from "react";
import type { ClubInfo } from "../types";
import type { ClubInfo } from "@/types";
import { EyeOutlined, StarFilled, StarOutlined } from "@ant-design/icons";
import { useClubStore } from "../store/useClubStore";
import { useClubStore } from "@/store/useClubStore";
import { CascaderProvinceCity } from "./CascaderProvinceCity";

View File

@ -2,11 +2,11 @@ import { Avatar, Button, Drawer, Dropdown, Flex, Skeleton, Typography } from "an
import { ChangeBackground } from "./ChangeBackground";
import { useMemo, useState } from "react";
import { useRequest } from "ahooks";
import type { ClubDetail } from "../types";
import { MapType, openWebMapRaw } from "../utils/front";
import type { ClubDetail } from "@/types";
import { MapType, openWebMapRaw } from "@/utils/front";
import type { ItemType } from "antd/es/menu/interface";
import { NotificationOutlined, PushpinOutlined, StarFilled, StarOutlined } from "@ant-design/icons";
import { useClubStore } from "../store/useClubStore";
import { useClubStore } from "@/store/useClubStore";
interface Props {
clubId: string;

View File

@ -1,5 +1,5 @@
import { Button, Card, Statistic, Typography } from "antd";
import type { IEventInfo } from "../types";
import type { IEventInfo } from "@/types";
import dayjs from "dayjs";
import utc from 'dayjs/plugin/utc';
import timezone from 'dayjs/plugin/timezone';
@ -8,10 +8,10 @@ import { useCallback, useContext, useEffect, useMemo, useState } from "react";
import { useNavigate } from "react-router";
import type { TimerType } from "antd/lib/statistic/Timer";
import { useLogto } from "@logto/react";
import { useAuthHeaders } from "../hooks/useAuthHeaders";
import { useAuthHeaders } from "@/hooks/useAuthHeaders";
import { useRequest } from "ahooks";
import { WebScoketContext } from "../context/WebsocketContext";
import { getEventSubKey } from "../utils/common";
import { WebScoketContext } from "@/context/WebsocketContext";
import { getEventSubKey } from "@/utils/common";
dayjs.extend(utc);
dayjs.extend(timezone);

View File

@ -1,9 +1,9 @@
import { useCallback, useEffect, useState } from "react";
import { useFavPlayerStore, type FavPlayer } from "../store/useFavPlayerStore";
import { useFavPlayerStore, type FavPlayer } from "@/store/useFavPlayerStore";
import styled from "styled-components";
import { useRequest } from "ahooks";
import { useLogto } from "@logto/react";
import { useAuthHeaders } from "../hooks/useAuthHeaders";
import { useAuthHeaders } from "@/hooks/useAuthHeaders";
import { StarFilled, StarOutlined } from "@ant-design/icons";
interface Props {

View File

@ -1,5 +1,5 @@
import type React from "react";
import type { BasePlayer, Player } from "../types";
import type { BasePlayer, Player } from "@/types";
import { Tabs } from "antd";
import { PlayerList } from "./PlayerList";
import { GroupingPrediction } from "./GroupingPrediction";

View File

@ -2,14 +2,14 @@ import { Button, Drawer, Flex, Select } from 'antd';
import type React from 'react';
import { clubs } from './clubList';
import { useCallback, useEffect, useState } from 'react';
import { ClubEvenList } from '../ClubEventList';
import { ClubEvenList } from '@/components/ClubEventList';
import { SearchOutlined } from '@ant-design/icons';
import { useClubStore } from '../../store/useClubStore';
import { ClubSearchTable } from '../ClubSearchTable';
import { useClubStore } from '@/store/useClubStore';
import { ClubSearchTable } from '@/components/ClubSearchTable';
import styled, { createGlobalStyle } from 'styled-components';
import { useLocalStorageState } from 'ahooks';
import { CLUB_SELECTOR_KEY } from '../../utils/constants';
import { ClubSummary } from '../ClubSummary';
import { CLUB_SELECTOR_KEY } from '@/utils/constants';
import { ClubSummary } from '@/components/ClubSummary';
interface Props {
}

View File

@ -1,5 +1,5 @@
import { Button, Divider, Flex, Table as AntTable, Skeleton } from "antd";
import type { GamesData } from "../types";
import type { GamesData } from "@/types";
import User from "./User";
import { useMemo, useState } from "react";
import { useRequest } from "ahooks";

View File

@ -1,6 +1,6 @@
import { useMemo, useState } from "react";
import { Button, Card, Drawer, Table } from "antd";
import type { BasePlayer } from "../types";
import type { BasePlayer } from "@/types";
import User from "./User";
import BattleTable from "./BattleTable";
import { ExpandOutlined } from "@ant-design/icons";

View File

@ -1,9 +1,9 @@
import React, { useCallback, useEffect, useMemo, useState } from "react";
import { Button, Flex, Form, InputNumber, Segmented, Space, Switch } from "antd";
import { chunk } from 'lodash';
import type { BasePlayer } from "../types";
import type { BasePlayer } from "@/types";
import { GroupMember } from "./GroupMember";
import { sneckGroup } from "../utils/common";
import { sneckGroup } from "@/utils/common";
import { useLoaderData } from "react-router";
import { SyncOutlined } from "@ant-design/icons";
import { useRequest } from "ahooks";

View File

@ -1,11 +1,11 @@
import { Outlet, useNavigation } from "react-router";
import { HydrateFallback } from "../HydrateFallback";
import { AppBar } from "../AppBar";
import { HydrateFallback } from "@/components/HydrateFallback";
import { AppBar } from "@/components/AppBar";
import styled from "styled-components";
import { WebScoketContext } from "../../context/WebsocketContext";
import { WebScoketContext } from "@/context/WebsocketContext";
import { Alert } from "antd";
import { useEffect } from "react";
import { initServiceWorker } from "../../utils/firebase-frontend";
import { initServiceWorker } from "@/utils/firebase-frontend";
const StyledContainer = styled.div`
padding-bottom: 90px;

View File

@ -1,6 +1,6 @@
import { Outlet, useNavigation } from "react-router";
import { HydrateFallback } from "../HydrateFallback";
import { MenuButtons } from "../MenuButtons";
import { HydrateFallback } from "@/components/HydrateFallback";
import { MenuButtons } from "@/components/MenuButtons";
export function BaseLayout() {
const navigation = useNavigation();

View File

@ -1,5 +1,5 @@
import { Button, Drawer, Flex, Form, Switch, Typography } from "antd";
import { useNotificationControl } from "../hooks/useNotificationControl";
import { useNotificationControl } from "@/hooks/useNotificationControl";
import { useCallback, useState } from "react";
const NotificationPermissionControl = () => {

View File

@ -1,5 +1,5 @@
import type React from "react";
import type { Player } from "../types";
import type { Player } from "@/types";
import { Avatar, Table } from "antd";
import User from "./User";

View File

@ -1,6 +1,6 @@
import { useRequest } from "ahooks";
import { Divider, Flex, Skeleton, Tag, Typography } from "antd";
import { EType, type XCXTag } from "../types";
import { EType, type XCXTag } from "@/types";
import { useLoaderData } from "react-router";
interface Props {

View File

@ -1,5 +1,5 @@
import { createContext } from "react";
import type { WsWebSendTopicPayload, WsWebSendTopics } from "../utils/common";
import type { WsWebSendTopicPayload, WsWebSendTopics } from "@/utils/common";
interface MessageSender {
messageSender?: <T extends WsWebSendTopics>(topic: T, data: WsWebSendTopicPayload[T]) => void;

View File

@ -1,6 +1,6 @@
import { useLogto } from "@logto/react"
import { useEffect, useState } from "react";
import { LOGTO_RESOURCE } from "../utils/constants";
import { LOGTO_RESOURCE } from "@/utils/constants";
import { App, Button } from "antd";
import useAutoLogin from "./useAutoLogin";

View File

@ -1,6 +1,6 @@
import { useCallback, useEffect } from "react";
import { ensureTopicData, fromServerMessage } from "../utils/common";
import { EVENT_WS_MESSAGE } from "../utils/constants";
import { ensureTopicData, fromServerMessage } from "@/utils/common";
import { EVENT_WS_MESSAGE } from "@/utils/constants";
import { App } from "antd";
export const useServerMessageHandler = () => {

View File

@ -1,7 +1,7 @@
import { useLoaderData } from "react-router";
import type { ClubDetail } from "../types";
import { ClubEvenList } from "../components/ClubEventList";
import { ClubSummary } from "../components/ClubSummary";
import type { ClubDetail } from "@/types";
import { ClubEvenList } from "@/components/ClubEventList";
import { ClubSummary } from "@/components/ClubSummary";
export const ClubEventsPage = () => {
const { info } = useLoaderData<{

View File

@ -1,6 +1,6 @@
import { useLoaderData } from "react-router";
import { GamePanel } from "../components/GamePanel";
import type { BasePlayer, MatchInfo, MatchSummary, XCXMember } from "../types";
import { GamePanel } from "@/components/GamePanel";
import type { BasePlayer, MatchInfo, MatchSummary, XCXMember } from "@/types";
import { Button, Typography } from "antd";
import { useMemo } from "react";
import { useTitle } from "ahooks";

View File

@ -1,13 +1,13 @@
import { Avatar, Button, Card, Divider, Flex, Image, Popconfirm, Radio, Segmented, Spin, Typography, App } from "antd";
import { useFavPlayerStore, type FavPlayer } from "../store/useFavPlayerStore";
import { useFavPlayerStore, type FavPlayer } from "@/store/useFavPlayerStore";
import { useNavigate } from "react-router";
import { useCallback, useEffect, useMemo, useState } from "react";
import { useLogto } from "@logto/react";
import { DeleteOutlined, LoginOutlined, SyncOutlined, UploadOutlined } from "@ant-design/icons";
import { useRequest } from "ahooks";
import type { XCXProfile } from "../types";
import useAutoLogin from "../hooks/useAutoLogin";
import { useAuthHeaders } from "../hooks/useAuthHeaders";
import type { XCXProfile } from "@/types";
import useAutoLogin from "@/hooks/useAutoLogin";
import { useAuthHeaders } from "@/hooks/useAuthHeaders";
import styled from "styled-components";
enum SortType {

View File

@ -1,8 +1,8 @@
import { useLocalStorageState, useRequest } from "ahooks";
import { Input, Table, Spin, Typography, Flex } from "antd";
import type { XCXFindUser, XCXFindUserResp } from "../types";
import User from "../components/User";
import { SEX } from "../utils/front";
import type { XCXFindUser, XCXFindUserResp } from "@/types";
import User from "@/components/User";
import { SEX } from "@/utils/front";
import dayjs from "dayjs";
export function FindUserPage() {

View File

@ -2,13 +2,13 @@ import React, { useEffect, useMemo } from "react";
import { Link, useLoaderData, useNavigate } from "react-router";
import { Avatar, Divider, Flex, Image, Typography } from "antd";
import { useTitle } from "ahooks";
import type { XCXProfile } from "../types/profile";
import User from "../components/User";
import { ChangeBackground } from "../components/ChangeBackground";
import UserTags from "../components/Tags";
import { GameTable } from "../components/GameTable";
import { FavButton } from "../components/FavButton";
import { useFavPlayerStore } from "../store/useFavPlayerStore";
import type { XCXProfile } from "@/types/profile";
import User from "@/components/User";
import { ChangeBackground } from "@/components/ChangeBackground";
import UserTags from "@/components/Tags";
import { GameTable } from "@/components/GameTable";
import { FavButton } from "@/components/FavButton";
import { useFavPlayerStore } from "@/store/useFavPlayerStore";
function Honor(props: { honors?: XCXProfile['honors'] }) {
if (!props.honors?.length) return null;

View File

@ -3,13 +3,13 @@ import { useLogto, type IdTokenClaims } from "@logto/react";
import { App, Avatar, Button, Divider, Flex, Typography } from "antd";
import { useCallback, useEffect, useState } from "react";
import { useLocation, useNavigate } from "react-router";
import { AUTH_CALLBACK_URL, USER_CENTER_URL } from "../utils/front";
import useAutoLogin from "../hooks/useAutoLogin";
import { LOGTO_DOMAIN } from "../utils/common";
import { useAppVersion } from "../hooks/useAppVersion";
import { BindKaiqiuAccount } from "../components/BindKaiqiuAccount";
import { ChangeBackground } from "../components/ChangeBackground";
import PermissionControlPanel from "../components/PermissionControlPanel";
import { AUTH_CALLBACK_URL, USER_CENTER_URL } from "@/utils/front";
import useAutoLogin from "@/hooks/useAutoLogin";
import { LOGTO_DOMAIN } from "@/utils/common";
import { useAppVersion } from "@/hooks/useAppVersion";
import { BindKaiqiuAccount } from "@/components/BindKaiqiuAccount";
import { ChangeBackground } from "@/components/ChangeBackground";
import PermissionControlPanel from "@/components/PermissionControlPanel";
enum modifyRoutes {
username = '/account/username',

View File

@ -25,6 +25,9 @@
// Some stricter flags (disabled by default)
"noUnusedLocals": false,
"noUnusedParameters": false,
"noPropertyAccessFromIndexSignature": false
"noPropertyAccessFromIndexSignature": false,
"paths": {
"@/*": ["./src/*"]
}
}
}