Skip to content

Commit 13ef0fd

Browse files
Fix all eslint problems
1 parent 1ea81a4 commit 13ef0fd

22 files changed

Lines changed: 85 additions & 76 deletions

src/client.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { StartClient } from "@tanstack/react-start";
22
import { StrictMode } from "react";
33
import { hydrateRoot } from "react-dom/client";
4+
import * as Sentry from "@sentry/tanstackstart-react";
45
import { createRouter } from "./router";
56

6-
import * as Sentry from "@sentry/tanstackstart-react";
77

88
const router = createRouter();
99

src/components/footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Github, ExternalLink, Heart } from "lucide-react";
1+
import { ExternalLink, Github, Heart } from "lucide-react";
22

33
export function Footer() {
44
return (

src/components/landing/landing-hero.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Shield, Clock, Lock, Flame } from "lucide-react";
1+
import { Clock, Flame, Lock, Shield } from "lucide-react";
22
import { Card, CardContent } from "~/components/ui/card";
33

44
export function LandingHero() {

src/components/landing/landing-process-flow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Edit3, Shield, Link2, Eye, Clock, Zap } from "lucide-react";
1+
import { Clock, Edit3, Eye, Link2, Shield, Zap } from "lucide-react";
22
import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card";
33

44
export function LandingProcessFlow() {

src/components/landing/landing-secret-form.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
import { useState } from "react";
22
import {
3+
AlertTriangle,
4+
CheckCircle,
5+
Copy,
6+
Eye,
37
Shield,
48
Zap,
5-
Eye,
6-
Copy,
7-
CheckCircle,
8-
AlertTriangle,
99
} from "lucide-react";
1010
import { Button } from "~/components/ui/button";
1111
import { Textarea } from "~/components/ui/textarea";
1212
import {
1313
Dialog,
1414
DialogContent,
15+
DialogDescription,
1516
DialogHeader,
1617
DialogTitle,
17-
DialogDescription,
1818
} from "~/components/ui/dialog";
1919
import {
2020
AlertDialog,
@@ -34,11 +34,11 @@ import {
3434
} from "~/components/ui/tooltip";
3535
import {
3636
Card,
37-
CardHeader,
38-
CardTitle,
39-
CardDescription,
4037
CardContent,
38+
CardDescription,
4139
CardFooter,
40+
CardHeader,
41+
CardTitle,
4242
} from "~/components/ui/card";
4343
import { useNewWhim } from "~/hooks/use-new-whim";
4444

src/components/theme-toggle.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
import { Button } from "./ui/button";
21
import { Moon, Sun } from "lucide-react";
32
import { useQueryClient, useSuspenseQuery } from "@tanstack/react-query";
3+
import { Button } from "./ui/button";
4+
import type { Theme } from "~/server/theme";
45
import { themeQuery } from "~/lib/queries";
5-
import { setThemeServerFn, type Theme } from "~/server/theme";
6+
import { setThemeServerFn } from "~/server/theme";
67

78
export function ThemeToggle() {
89
const queryClient = useQueryClient();

src/components/ui/button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as React from "react"
22
import { Slot } from "@radix-ui/react-slot"
3-
import { cva, type VariantProps } from "class-variance-authority"
3+
import { cva } from "class-variance-authority"
4+
import type {VariantProps} from "class-variance-authority";
45

56
import { cn } from "~/lib/utils"
67

src/components/ui/input-otp.tsx

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
import * as React from "react"
2-
import { OTPInput, OTPInputContext } from "input-otp"
3-
import { MinusIcon } from "lucide-react"
1+
import * as React from "react";
2+
import { OTPInput, OTPInputContext } from "input-otp";
3+
import { MinusIcon } from "lucide-react";
44

5-
import { cn } from "~/lib/utils"
5+
import { cn } from "~/lib/utils";
66

77
function InputOTP({
88
className,
99
containerClassName,
1010
...props
1111
}: React.ComponentProps<typeof OTPInput> & {
12-
containerClassName?: string
12+
containerClassName?: string;
1313
}) {
1414
return (
1515
<OTPInput
@@ -21,7 +21,7 @@ function InputOTP({
2121
className={cn("disabled:cursor-not-allowed", className)}
2222
{...props}
2323
/>
24-
)
24+
);
2525
}
2626

2727
function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
@@ -31,18 +31,18 @@ function InputOTPGroup({ className, ...props }: React.ComponentProps<"div">) {
3131
className={cn("flex items-center", className)}
3232
{...props}
3333
/>
34-
)
34+
);
3535
}
3636

3737
function InputOTPSlot({
3838
index,
3939
className,
4040
...props
4141
}: React.ComponentProps<"div"> & {
42-
index: number
42+
index: number;
4343
}) {
44-
const inputOTPContext = React.useContext(OTPInputContext)
45-
const { char, hasFakeCaret, isActive } = inputOTPContext?.slots[index] ?? {}
44+
const inputOTPContext = React.useContext(OTPInputContext);
45+
const { char, hasFakeCaret, isActive } = inputOTPContext.slots[index] ?? {};
4646

4747
return (
4848
<div
@@ -61,15 +61,15 @@ function InputOTPSlot({
6161
</div>
6262
)}
6363
</div>
64-
)
64+
);
6565
}
6666

6767
function InputOTPSeparator({ ...props }: React.ComponentProps<"div">) {
6868
return (
6969
<div data-slot="input-otp-separator" role="separator" {...props}>
7070
<MinusIcon />
7171
</div>
72-
)
72+
);
7373
}
7474

75-
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator }
75+
export { InputOTP, InputOTPGroup, InputOTPSlot, InputOTPSeparator };

src/hooks/use-get-whim.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ import { decryptWhim } from "~/lib/crypto-utils";
66

77
export function useGetWhim(id: string, otp: string) {
88
return useQuery({
9-
queryKey: ["whim", id],
10-
async queryFn({ queryKey: [, id] }) {
9+
queryKey: ["whim", id] as const,
10+
async queryFn({ queryKey: [, whimId] }) {
1111
let encryptedWhim;
1212

1313
try {
14-
encryptedWhim = await getWhim({ data: { id } });
14+
encryptedWhim = await getWhim({ data: { id: whimId } });
1515
} catch (error) {
1616
if (
1717
error instanceof Error &&
@@ -33,7 +33,7 @@ export function useGetWhim(id: string, otp: string) {
3333
);
3434

3535
try {
36-
await deleteWhim({ data: { id } });
36+
await deleteWhim({ data: { id: whimId } });
3737
return { message: decryptedMessage, deletionFailed: false };
3838
} catch (deleteError) {
3939
console.error("Failed to delete whim:", deleteError);
@@ -47,7 +47,7 @@ export function useGetWhim(id: string, otp: string) {
4747
} catch (decryptError) {
4848
if (isDecryptionError(decryptError)) {
4949
try {
50-
await incrementFailedAttempts({ data: { id } });
50+
await incrementFailedAttempts({ data: { id: whimId } });
5151
} catch (incrementError) {
5252
console.error(
5353
"Failed to increment failed attempts:",

src/lib/db/schema.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { sql } from "drizzle-orm";
22
import { check, sqliteTable } from "drizzle-orm/sqlite-core";
33

4-
export type Whim = typeof whims.$inferSelect;
54
export const whims = sqliteTable("whims", t => ({
65
id: t.text().primaryKey(),
76
encryptedMessage: t.blob({ mode: "buffer" }).notNull(),
@@ -34,3 +33,7 @@ export const stats = sqliteTable(
3433
}),
3534
table => [check("single_row_check", sql`${table.id} = 1`)]
3635
);
36+
37+
export type Attempts = typeof attempts.$inferSelect;
38+
export type Stats = typeof stats.$inferSelect;
39+
export type Whim = typeof whims.$inferSelect;

0 commit comments

Comments
 (0)