Skip to content

Commit 362ac6e

Browse files
committed
chore: fix linting errors
1 parent 969f18b commit 362ac6e

25 files changed

+61
-50
lines changed

components/AddButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function AddButton(
66
type = "submit",
77
children,
88
...props
9-
}: JSX.HTMLAttributes<HTMLButtonElement>,
9+
}: JSX.ButtonHTMLAttributes<HTMLButtonElement>,
1010
) {
1111
return (
1212
<button

components/AppFrame.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ export function AppFrame(
2020
},
2121
) {
2222
return (
23-
<div class={"antialiased bg-gray-50 dark:bg-gray-900"}>
23+
<div class="antialiased bg-gray-50 dark:bg-gray-900">
2424
<nav class="bg-white border-b border-gray-200 px-4 py-2.5 dark:bg-gray-800 dark:border-gray-700 fixed left-0 right-0 top-0 z-50">
2525
<div class="flex flex-wrap justify-between items-center">
2626
<div class="flex justify-start items-center">

components/CloseButton.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function CloseButton(
66
class: className,
77
type = "button",
88
...props
9-
}: JSX.HTMLAttributes<HTMLButtonElement>,
9+
}: JSX.ButtonHTMLAttributes<HTMLButtonElement>,
1010
) {
1111
return (
1212
<button

components/DbList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export function DbList({ project, dbs }: { project: string; dbs: DashDb[] }) {
1010
<div>
1111
<h1 class="text-xl font-bold py-2">KV Databases</h1>
1212
<ul class="space-y-2">
13-
{dbs.map((db) => <Db project={project} db={db} />)}
13+
{dbs.map((db, idx) => <Db key={idx} project={project} db={db} />)}
1414
</ul>
1515
</div>
1616
);

components/Dialog.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { useSignalEffect } from "@preact/signals";
33
import { useRef } from "preact/hooks";
44
import { asSignal } from "$utils/signals.ts";
55

6-
interface DialogProps extends JSX.HTMLAttributes<HTMLDialogElement> {
6+
interface DialogProps extends JSX.DialogHTMLAttributes<HTMLDialogElement> {
77
returnValue?: JSX.SignalLike<string>;
88
}
99

components/DialogAddUpdateLocal.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -93,8 +93,7 @@ export function DialogAddUpdateLocal(
9393
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 md:w-96"
9494
placeholder="Path (on server) to local store"
9595
required
96-
>
97-
</input>
96+
/>
9897
</div>
9998
)}
10099
<div class="sm:col-span-2">
@@ -107,8 +106,7 @@ export function DialogAddUpdateLocal(
107106
value={store?.name}
108107
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500 md:w-96"
109108
placeholder="Friendly name (optional)"
110-
>
111-
</input>
109+
/>
112110
</div>
113111
</div>
114112
<div class="w-full my-2 md:w-auto flex flex-col md:flex-row space-y-2 md:space-y-0 items-stretch md:items-center md:space-x-3 flex-shrink-0">

components/DialogAddUpdateRemote.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,7 @@ export function DialogAddUpdateRemote(
114114
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
115115
placeholder="Location of remote store"
116116
required
117-
>
118-
</input>
117+
/>
119118
</div>
120119
<div>
121120
<Label for="name">Name</Label>
@@ -127,8 +126,7 @@ export function DialogAddUpdateRemote(
127126
value={store?.name}
128127
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
129128
placeholder="Label for URL (optional)"
130-
>
131-
</input>
129+
/>
132130
</div>
133131
<div>
134132
<Label for="access_token">Access Token</Label>
@@ -140,8 +138,7 @@ export function DialogAddUpdateRemote(
140138
class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg focus:ring-primary-600 focus:border-primary-600 block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white dark:focus:ring-primary-500 dark:focus:border-primary-500"
141139
placeholder="Token to access remote store"
142140
required
143-
>
144-
</input>
141+
/>
145142
</div>
146143
</div>
147144
<div class="w-full my-2 md:w-auto flex flex-col md:flex-row space-y-2 md:space-y-0 items-stretch md:items-center md:space-x-3 flex-shrink-0">

components/DialogDeleteEntries.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ export function DialogDeleteEntries(
3030
loadKeys(): void;
3131
},
3232
) {
33-
if (!databaseId) {
34-
return null;
35-
}
3633
const form = useRef<HTMLFormElement>(null);
3734
const alert = useSignal<ComponentChildren>(undefined);
3835
const loading = useSignal(false);
@@ -67,6 +64,10 @@ export function DialogDeleteEntries(
6764

6865
useSignalEffect(loadTree);
6966

67+
if (!databaseId) {
68+
return null;
69+
}
70+
7071
return (
7172
<Dialog
7273
class="p-4 bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5 md:w-1/2 xl:w-1/3"

components/DialogEditValue.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ export function DialogEditValue(
3737
loadValue(): void;
3838
},
3939
) {
40-
if (!entry.value) {
41-
return null;
42-
}
4340
const form = useRef<HTMLFormElement>(null);
4441
const alert = useSignal<ComponentChildren>(undefined);
4542

@@ -50,6 +47,10 @@ export function DialogEditValue(
5047
);
5148
const key = useComputed(() => entry.value!.key);
5249

50+
if (!entry.value) {
51+
return null;
52+
}
53+
5354
return (
5455
<Dialog
5556
class="p-4 bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5"

components/DialogExport.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ export function DialogExport(
1313
prefix: Signal<KvKeyJSON>;
1414
},
1515
) {
16-
if (!databaseId) {
17-
return null;
18-
}
19-
2016
const href = useComputed(() =>
2117
`/api/kv/${databaseId}/_bulk/${keyJsonToPath(prefix.value)}`
2218
);
2319

20+
if (!databaseId) {
21+
return null;
22+
}
23+
2424
return (
2525
<Dialog
2626
class="p-4 bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5"

0 commit comments

Comments
 (0)