清理 lint 剩余告警并更新审计文档状态
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { describe, it, expect, vi } from "vitest";
|
||||
import { describe, it, expect } from "vitest";
|
||||
import { render, screen } from "@testing-library/react";
|
||||
import userEvent from "@testing-library/user-event";
|
||||
import Input from "./Input";
|
||||
|
||||
@@ -23,7 +23,7 @@ vi.mock("./ShareCardModal", () => ({
|
||||
}));
|
||||
|
||||
vi.mock("./RestaurantImage", () => ({
|
||||
default: ({ alt }: { alt: string }) => <img alt={alt} />,
|
||||
default: ({ alt }: { alt: string }) => <div role="img" aria-label={alt} />,
|
||||
}));
|
||||
|
||||
vi.mock("./AuthModal", () => ({
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
"use client";
|
||||
/* eslint-disable @next/next/no-img-element -- Uses raw img for unrestricted external sources and card capture fidelity. */
|
||||
|
||||
import { useState, useCallback } from "react";
|
||||
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @next/next/no-img-element -- Share card rendering requires direct img tags for html-to-image output. */
|
||||
import { Star, MapPin, Zap } from "lucide-react";
|
||||
import type { Restaurant, MatchType, SceneType } from "@/types";
|
||||
import { getSceneConfig } from "@/lib/sceneConfig";
|
||||
|
||||
@@ -83,8 +83,6 @@ export default function RoomManageModal({
|
||||
[roomId, userId, toast, onClose],
|
||||
);
|
||||
|
||||
const otherUsers = users.filter((u) => u !== userId);
|
||||
|
||||
return (
|
||||
<Modal open={open} onClose={onClose}>
|
||||
<button
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/* eslint-disable @next/next/no-img-element -- Share card rendering requires direct img tags for html-to-image output. */
|
||||
import { QRCodeSVG } from "qrcode.react";
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
|
||||
@@ -299,7 +299,6 @@ export default function SwipeDeck({
|
||||
if (serverIndex === 0 && currentIndexRef.current > 0 && !resetting) {
|
||||
clearLocalState();
|
||||
}
|
||||
// eslint-disable-next-line react-hooks/exhaustive-deps
|
||||
}, [swipeCounts, userId, resetting, clearLocalState]);
|
||||
|
||||
const handleReset = useCallback(async () => {
|
||||
|
||||
@@ -5,7 +5,6 @@ import { QrCode, LogOut, Crown, Lock } from "lucide-react";
|
||||
import QrInviteModal from "./QrInviteModal";
|
||||
import RoomManageModal from "./RoomManageModal";
|
||||
import type { UserProfile, SceneType } from "@/types";
|
||||
import { getSceneConfig } from "@/lib/sceneConfig";
|
||||
|
||||
interface TopNavProps {
|
||||
roomId: string;
|
||||
@@ -34,7 +33,6 @@ export default function TopNav({
|
||||
userProfiles = {},
|
||||
scene = "eat",
|
||||
}: TopNavProps) {
|
||||
const sceneConfig = getSceneConfig(scene);
|
||||
const [showQr, setShowQr] = useState(false);
|
||||
const [showManage, setShowManage] = useState(false);
|
||||
|
||||
@@ -51,6 +49,7 @@ export default function TopNav({
|
||||
</button>
|
||||
<button
|
||||
onClick={() => setShowQr(true)}
|
||||
aria-label={`邀请二维码(${roomId})${typeof userCount === "number" ? `,当前 ${userCount} 人` : ""}`}
|
||||
className="flex items-center gap-1 rounded-full bg-accent/15 px-2.5 py-1 text-xs font-semibold text-accent transition-colors active:bg-accent/25"
|
||||
>
|
||||
<QrCode size={13} />
|
||||
|
||||
Reference in New Issue
Block a user