chore(format): add prettier-plugin-organize-imports and sort imports

This commit is contained in:
zetaloop
2026-02-25 15:34:33 +08:00
parent d4a0765cad
commit 2d42473910
88 changed files with 266 additions and 246 deletions
+2 -2
View File
@@ -1,10 +1,10 @@
"use client"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"
import { Bell, CreditCard, Settings, ShieldCheck } from "lucide-react"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"
const links = [
{ href: "/settings", label: "个人设置", icon: Settings },
+1 -1
View File
@@ -1,9 +1,9 @@
"use client"
import { useEffect, useRef } from "react"
import { Button } from "@/components/ui/button"
import { useAuthStore } from "@/store/auth"
import { useLoginDialogStore } from "@/store/login-dialog"
import { useEffect, useRef } from "react"
interface AuthGuardProps {
children: React.ReactNode
+3 -3
View File
@@ -1,5 +1,8 @@
"use client"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"
import { useAuthStore } from "@/store/auth"
import {
ClipboardList,
Gamepad2,
@@ -13,9 +16,6 @@ import {
} from "lucide-react"
import Link from "next/link"
import { usePathname } from "next/navigation"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"
import { useAuthStore } from "@/store/auth"
export const playerLinks = [
{ href: "/dashboard", label: "概览", icon: LayoutDashboard },
+1 -1
View File
@@ -1,10 +1,10 @@
"use client"
import { Heart } from "lucide-react"
import { Button } from "@/components/ui/button"
import { useRequireAuth } from "@/lib/use-require-auth"
import { useAuthStore } from "@/store/auth"
import { useFavoriteStore } from "@/store/favorites"
import { Heart } from "lucide-react"
interface FavoriteButtonProps {
initialFavorited: boolean
+14 -14
View File
@@ -1,19 +1,5 @@
"use client"
import {
Bell,
Gamepad2,
LogOut,
Menu,
MessageSquare,
Settings,
ShoppingBag,
User,
Wallet,
} from "lucide-react"
import Link from "next/link"
import { usePathname, useRouter } from "next/navigation"
import { useState } from "react"
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { Badge } from "@/components/ui/badge"
import { Button } from "@/components/ui/button"
@@ -32,6 +18,20 @@ import { cn } from "@/lib/utils"
import { useAuthStore } from "@/store/auth"
import { useNotificationStore } from "@/store/notifications"
import { useShopStore } from "@/store/shops"
import {
Bell,
Gamepad2,
LogOut,
Menu,
MessageSquare,
Settings,
ShoppingBag,
User,
Wallet,
} from "lucide-react"
import Link from "next/link"
import { usePathname, useRouter } from "next/navigation"
import { useState } from "react"
import { canAccessDashboard } from "@/components/role-guard"
+4 -4
View File
@@ -1,9 +1,5 @@
"use client"
import { standardSchemaResolver } from "@hookform/resolvers/standard-schema"
import { useRouter } from "next/navigation"
import { useForm } from "react-hook-form"
import { z } from "zod"
import { Button } from "@/components/ui/button"
import {
Dialog,
@@ -17,6 +13,10 @@ import { Label } from "@/components/ui/label"
import { getCurrentUserForLogin } from "@/lib/api"
import { useAuthStore } from "@/store/auth"
import { useLoginDialogStore } from "@/store/login-dialog"
import { standardSchemaResolver } from "@hookform/resolvers/standard-schema"
import { useRouter } from "next/navigation"
import { useForm } from "react-hook-form"
import { z } from "zod"
const loginSchema = z.object({
phone: z.string().min(11, "请输入正确的手机号"),
+11 -11
View File
@@ -1,16 +1,5 @@
"use client"
import {
AlertTriangle,
CheckCircle2,
Clock,
MessageSquare,
RefreshCw,
Star,
XCircle,
} from "lucide-react"
import Link from "next/link"
import { useCallback } from "react"
import { Button } from "@/components/ui/button"
import {
acceptOrder,
@@ -25,6 +14,17 @@ import { useAuthStore } from "@/store/auth"
import { useChatStore } from "@/store/chat"
import { useOrderStore } from "@/store/orders"
import { useShopStore } from "@/store/shops"
import {
AlertTriangle,
CheckCircle2,
Clock,
MessageSquare,
RefreshCw,
Star,
XCircle,
} from "lucide-react"
import Link from "next/link"
import { useCallback } from "react"
interface OrderActionsProps {
orderId: string
+1 -1
View File
@@ -1,7 +1,7 @@
"use client"
import { MessageCircle } from "lucide-react"
import { useCommentStore } from "@/store/comments"
import { MessageCircle } from "lucide-react"
interface PostCommentCountProps {
postId: string
+2 -2
View File
@@ -1,10 +1,10 @@
"use client"
import { Heart } from "lucide-react"
import { useMemo, useState } from "react"
import { addComment, toggleCommentLike } from "@/lib/api/comments"
import { useRequireAuth } from "@/lib/use-require-auth"
import { useCommentStore } from "@/store/comments"
import { Heart } from "lucide-react"
import { useMemo, useState } from "react"
import { Avatar, AvatarFallback, AvatarImage } from "./ui/avatar"
import { Button } from "./ui/button"
import { Textarea } from "./ui/textarea"
+1 -1
View File
@@ -1,9 +1,9 @@
"use client"
import { Heart } from "lucide-react"
import { togglePostLike } from "@/lib/api/posts"
import { useRequireAuth } from "@/lib/use-require-auth"
import { usePostStore } from "@/store/posts"
import { Heart } from "lucide-react"
interface PostLikeButtonProps {
postId: string
+2 -2
View File
@@ -1,10 +1,10 @@
"use client"
import { usePathname, useRouter } from "next/navigation"
import { useEffect } from "react"
import { ownerLinks, playerLinks } from "@/components/dashboard-sidebar"
import type { UserRole } from "@/lib/types"
import { useAuthStore } from "@/store/auth"
import { usePathname, useRouter } from "next/navigation"
import { useEffect } from "react"
const dashboardRoutes: Record<string, readonly { href: string }[]> = {
player: playerLinks,
+1 -1
View File
@@ -93,4 +93,4 @@ function AvatarGroupCount({ className, ...props }: React.ComponentProps<"div">)
)
}
export { Avatar, AvatarImage, AvatarFallback, AvatarBadge, AvatarGroup, AvatarGroupCount }
export { Avatar, AvatarBadge, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarImage }
+1 -1
View File
@@ -72,4 +72,4 @@ function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
)
}
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent }
export { Card, CardAction, CardContent, CardDescription, CardFooter, CardHeader, CardTitle }
+6 -6
View File
@@ -1,8 +1,5 @@
"use client"
import { Command as CommandPrimitive } from "cmdk"
import { SearchIcon } from "lucide-react"
import type * as React from "react"
import {
Dialog,
DialogContent,
@@ -11,6 +8,9 @@ import {
DialogTitle,
} from "@/components/ui/dialog"
import { cn } from "@/lib/utils"
import { Command as CommandPrimitive } from "cmdk"
import { SearchIcon } from "lucide-react"
import type * as React from "react"
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
return (
@@ -150,11 +150,11 @@ function CommandShortcut({ className, ...props }: React.ComponentProps<"span">)
export {
Command,
CommandDialog,
CommandInput,
CommandList,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandShortcut,
CommandList,
CommandSeparator,
CommandShortcut,
}
+2 -2
View File
@@ -1,10 +1,10 @@
"use client"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"
import { XIcon } from "lucide-react"
import { Dialog as DialogPrimitive } from "radix-ui"
import type * as React from "react"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"
function Dialog({ ...props }: React.ComponentProps<typeof DialogPrimitive.Root>) {
return <DialogPrimitive.Root data-slot="dialog" {...props} />
+5 -5
View File
@@ -211,18 +211,18 @@ function DropdownMenuSubContent({
export {
DropdownMenu,
DropdownMenuPortal,
DropdownMenuTrigger,
DropdownMenuCheckboxItem,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuLabel,
DropdownMenuItem,
DropdownMenuCheckboxItem,
DropdownMenuLabel,
DropdownMenuPortal,
DropdownMenuRadioGroup,
DropdownMenuRadioItem,
DropdownMenuSeparator,
DropdownMenuShortcut,
DropdownMenuSub,
DropdownMenuSubTrigger,
DropdownMenuSubContent,
DropdownMenuSubTrigger,
DropdownMenuTrigger,
}
+6 -6
View File
@@ -1,5 +1,7 @@
"use client"
import { Label } from "@/components/ui/label"
import { cn } from "@/lib/utils"
import type { Label as LabelPrimitive } from "radix-ui"
import { Slot } from "radix-ui"
import * as React from "react"
@@ -12,8 +14,6 @@ import {
useFormContext,
useFormState,
} from "react-hook-form"
import { Label } from "@/components/ui/label"
import { cn } from "@/lib/utils"
const Form = FormProvider
@@ -140,12 +140,12 @@ function FormMessage({ className, ...props }: React.ComponentProps<"p">) {
}
export {
useFormField,
Form,
FormItem,
FormLabel,
FormControl,
FormDescription,
FormMessage,
FormField,
FormItem,
FormLabel,
FormMessage,
useFormField,
}
+3 -3
View File
@@ -65,10 +65,10 @@ function PopoverDescription({ className, ...props }: React.ComponentProps<"p">)
export {
Popover,
PopoverTrigger,
PopoverContent,
PopoverAnchor,
PopoverContent,
PopoverDescription,
PopoverHeader,
PopoverTitle,
PopoverDescription,
PopoverTrigger,
}
+4 -4
View File
@@ -124,11 +124,11 @@ function SheetDescription({
export {
Sheet,
SheetTrigger,
SheetClose,
SheetContent,
SheetHeader,
SheetFooter,
SheetTitle,
SheetDescription,
SheetFooter,
SheetHeader,
SheetTitle,
SheetTrigger,
}
+1 -1
View File
@@ -89,4 +89,4 @@ function TableCaption({ className, ...props }: React.ComponentProps<"caption">)
)
}
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption }
export { Table, TableBody, TableCaption, TableCell, TableFooter, TableHead, TableHeader, TableRow }
+1 -1
View File
@@ -78,4 +78,4 @@ function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPr
)
}
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants }
export { Tabs, TabsContent, TabsList, tabsListVariants, TabsTrigger }
+1 -1
View File
@@ -50,4 +50,4 @@ function TooltipContent({
)
}
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }
export { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger }