清理 lint 剩余告警并更新审计文档状态

This commit is contained in:
2026-03-03 13:53:19 +08:00
parent d91ea8c1e8
commit 482307f2f4
21 changed files with 33 additions and 27 deletions
@@ -1,7 +1,7 @@
import { describe, it, expect, vi, beforeEach } from "vitest";
import { prismaMock, resetPrismaMock } from "@/__tests__/helpers/prisma-mock";
import { createRequest, createRouteContext, parseJsonResponse } from "@/__tests__/helpers/api-test-utils";
import { TEST_BLINDBOX_ROOM, TEST_USER } from "@/__tests__/helpers/fixtures";
import { TEST_BLINDBOX_ROOM } from "@/__tests__/helpers/fixtures";
vi.mock("@/lib/auth", () => ({
getAuthUserId: vi.fn().mockResolvedValue("user-1"),
+2 -2
View File
@@ -1,6 +1,6 @@
import { describe, it, expect, vi, beforeEach } from "vitest";
import { createRequest, createRouteContext, parseJsonResponse } from "@/__tests__/helpers/api-test-utils";
import { TEST_ROOM_DATA, TEST_RESTAURANT } from "@/__tests__/helpers/fixtures";
import { createRequest, createRouteContext } from "@/__tests__/helpers/api-test-utils";
import { TEST_ROOM_DATA } from "@/__tests__/helpers/fixtures";
vi.mock("@/lib/prisma", () => ({ prisma: {} }));
+1 -1
View File
@@ -1,6 +1,6 @@
import { describe, it, expect, vi, beforeEach } from "vitest";
import { createRequest, createRouteContext, parseJsonResponse } from "@/__tests__/helpers/api-test-utils";
import { TEST_ROOM_DATA, TEST_RESTAURANT, TEST_RESTAURANT_2 } from "@/__tests__/helpers/fixtures";
import { TEST_ROOM_DATA, TEST_RESTAURANT } from "@/__tests__/helpers/fixtures";
vi.mock("@/lib/prisma", () => ({ prisma: {} }));
+1 -1
View File
@@ -1,5 +1,5 @@
import { describe, it, expect, vi, beforeEach } from "vitest";
import { render, screen, waitFor } from "@testing-library/react";
import { render, waitFor } from "@testing-library/react";
import React from "react";
import { ToastContext, type ToastContextValue } from "@/hooks/useToast";
+6 -2
View File
@@ -121,7 +121,11 @@ function RoomCard({
tabIndex={0}
onClick={(e) => {
e.stopPropagation();
confirmDelete ? onCancelDelete() : onRequestDelete();
if (confirmDelete) {
onCancelDelete();
} else {
onRequestDelete();
}
}}
className="flex h-7 w-7 shrink-0 items-center justify-center rounded-full text-muted/40 transition-colors hover:bg-elevated hover:text-muted active:text-foreground"
>
@@ -276,7 +280,7 @@ export default function BlindboxLobbyPage() {
} finally {
setDeletingId(null);
}
}, [deletingId, profile, toast]);
}, [deletingId, profile, toast, mutateRooms]);
return (
<div className="relative flex min-h-dvh flex-col items-center justify-center bg-background px-6 py-6 overflow-y-auto scrollbar-none">
+2 -1
View File
@@ -1,6 +1,7 @@
"use client";
import { useEffect } from "react";
import Image from "next/image";
export default function GlobalError({
error,
@@ -17,7 +18,7 @@ export default function GlobalError({
<html lang="zh-CN">
<body style={{ margin: 0, fontFamily: "system-ui, sans-serif", background: "#0a0a0a", color: "#e5e5e5" }}>
<div style={{ display: "flex", minHeight: "100dvh", flexDirection: "column", alignItems: "center", justifyContent: "center", padding: "1.5rem" }}>
<img src="/error-robot.png" alt="错误" style={{ width: 120, height: 120 }} />
<Image src="/error-robot.png" alt="错误" width={120} height={120} priority />
<h1 style={{ marginTop: "1.5rem", fontSize: "1.25rem", fontWeight: 700 }}></h1>
<p style={{ marginTop: "0.5rem", fontSize: "0.875rem", color: "#a3a3a3", textAlign: "center" }}>
-3
View File
@@ -10,7 +10,6 @@ import Button from "@/components/Button";
import { useRoomPolling } from "@/hooks/useRoomPolling";
import { getUserId } from "@/lib/userId";
import { joinRoom } from "@/lib/room";
import { getSceneConfig } from "@/lib/sceneConfig";
import { useToast } from "@/hooks/useToast";
export default function RoomPage() {
@@ -126,8 +125,6 @@ export default function RoomPage() {
const initialIndex = swipeCounts[userId] ?? 0;
const ready = joined && userId && restaurants.length > 0;
const sceneConfig = getSceneConfig(scene);
if (!ready) {
return <SwipeDeckSkeleton />;
}