Fix some lint errors

This commit is contained in:
Fergal Moran
2024-02-02 18:52:53 +00:00
parent 94e3ae5982
commit fcfd23ccdd
12 changed files with 29 additions and 47 deletions

View File

@@ -8,7 +8,7 @@ type DeviceConnectRequest = {
childId: string;
deviceName: string;
};
const POST = async (req: Request, res: Response) => {
export const POST = async (req: Request, res: Response) => {
if (req.method !== "POST") {
return badRequest("Invalid method");
}

View File

@@ -5,14 +5,11 @@ import ChildModal from "./child-modal";
import {
Table,
TableBody,
TableCaption,
TableCell,
TableHead,
TableHeader,
TableRow,
} from "@/components/ui/table";
import { Button } from "@/components/ui/button";
import { Icons } from "@/components/icons";
import ConnectDeviceDialog from "@/components/children/connect-device-dialog";
export default function ChildList({ children }: { children: CompleteChild[] }) {

View File

@@ -73,17 +73,17 @@ const DeviceForm = ({
const { mutate: createDevice, isLoading: isCreating } =
trpc.devices.createDevice.useMutation({
onSuccess: (res) => onSuccess("create"),
onSuccess: (_res) => onSuccess("create"),
});
const { mutate: updateDevice, isLoading: isUpdating } =
trpc.devices.updateDevice.useMutation({
onSuccess: (res) => onSuccess("update"),
onSuccess: (_res) => onSuccess("update"),
});
const { mutate: deleteDevice, isLoading: isDeleting } =
trpc.devices.deleteDevice.useMutation({
onSuccess: (res) => onSuccess("delete"),
onSuccess: (_res) => onSuccess("delete"),
});
const handleSubmit = (values: NewDeviceParams) => {

View File

@@ -40,7 +40,7 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
const signInResult = await signIn("email", {
email: data.email.toLowerCase(),
redirect: false,
callbackUrl: searchParams?.get("from") || "/dashboard",
callbackUrl: searchParams?.get("from") ?? "/dashboard",
});
setIsLoading(false);

View File

@@ -7,19 +7,16 @@ import {
Loader2,
MessageCircleMore,
Moon,
PlusCircle,
SunMedium,
Twitter,
Twitter, //get fucked, I will call this X when I have to and not before
User,
Rocket,
PlusCircleIcon,
PlusIcon,
LogIn,
Save,
Copy,
Cable,
Edit,
Edit2,
Radar,
PhoneCall,
Smartphone,

View File

@@ -1,10 +1,6 @@
import React, {
ForwardRefExoticComponent,
RefAttributes,
RefObject,
} from "react";
import React from "react";
import L from "leaflet";
import { Marker, Popup, PopupProps } from "react-leaflet";
import { Marker, Popup } from "react-leaflet";
import {
Card,
CardContent,
@@ -17,7 +13,6 @@ import Link from "next/link";
import { Icons } from "@/components/icons";
import { usePingSocket } from "@/lib/hooks/use-ping-socket";
import { getInitials } from "@/lib/helpers/name";
import { Bold } from "lucide-react";
import { Button } from "@/components/ui/button";
import { humanizeDate } from "@/lib/helpers/date";
@@ -53,6 +48,7 @@ const MapMarker: React.FC<MapMarkerProps> = ({
longitude,
]);
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const popup = React.createRef<any>();
usePingSocket({

View File

@@ -1,10 +1,6 @@
import React from "react";
type MapTooltipProps = {
prop1: string;
};
const MapTooltip: React.FC<MapTooltipProps> = ({ prop1 }) => {
const MapTooltip: React.FC = () => {
return <div>MapTooltip</div>;
};

View File

@@ -4,7 +4,6 @@ import dynamic from "next/dynamic";
import ChildrenFilter from "../children/children-filter";
import { MapViewTypeSelector } from "../maps/map-viewtype-selector";
import { type CompleteChild } from "@/server/db/schema/children";
import { Button } from "@/components/ui/button";
const Map = dynamic(() => import("@/components/maps/main-map"), {
ssr: false,

View File

@@ -1,18 +1,18 @@
"use client"
"use client";
import * as React from "react"
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group"
import { type VariantProps } from "class-variance-authority"
import * as React from "react";
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
import { type VariantProps } from "class-variance-authority";
import { cn } from "@/lib/utils"
import { toggleVariants } from "@/components/ui/toggle"
import { cn } from "@/lib/utils";
import { toggleVariants } from "@/components/ui/toggle";
const ToggleGroupContext = React.createContext<
VariantProps<typeof toggleVariants>
>({
size: "default",
variant: "default",
})
});
const ToggleGroup = React.forwardRef<
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
@@ -28,34 +28,34 @@ const ToggleGroup = React.forwardRef<
{children}
</ToggleGroupContext.Provider>
</ToggleGroupPrimitive.Root>
))
));
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
const ToggleGroupItem = React.forwardRef<
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
VariantProps<typeof toggleVariants>
>(({ className, children, variant, size, ...props }, ref) => {
const context = React.useContext(ToggleGroupContext)
const context = React.useContext(ToggleGroupContext);
return (
<ToggleGroupPrimitive.Item
ref={ref}
className={cn(
toggleVariants({
variant: context.variant || variant,
size: context.size || size,
variant: context.variant ?? variant,
size: context.size ?? size,
}),
className
className,
)}
{...props}
>
{children}
</ToggleGroupPrimitive.Item>
)
})
);
});
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
export { ToggleGroup, ToggleGroupItem }
export { ToggleGroup, ToggleGroupItem };

View File

@@ -5,8 +5,6 @@ import { Icons } from '@/components/icons';
import { useSocket } from '@/lib/services/realtime/socket-provider';
const PresenceIndicator = () => {
const { isConnected } = useSocket();
const [isOnline, setIsOnline] = React.useState(true);
return (
<span className='relative inline-flex'>
<Button variant='ghost' size='icon'>

View File

@@ -1,5 +1,5 @@
import { type SidebarLink } from "@/components/SidebarItems";
import { Cog, Globe, HomeIcon } from "lucide-react";
import { Cog, HomeIcon } from "lucide-react";
type AdditionalLinks = {
title: string;

View File

@@ -1,7 +1,6 @@
import { db } from "@/server/db/index";
import { eq, and } from "drizzle-orm";
import { getUserAuth } from "@/lib/auth/utils";
import { type PingId, pingIdSchema, pings } from "@/server/db/schema/pings";
import { type PingId, pingIdSchema } from "@/server/db/schema/pings";
export const getPings = async () => {
const { session } = await getUserAuth();