aboutsummaryrefslogtreecommitdiffstats
path: root/apps/web/components
diff options
context:
space:
mode:
authorxuatz <xzlow10@gmail.com>2025-06-22 20:29:30 +0900
committerGitHub <noreply@github.com>2025-06-22 12:29:30 +0100
commitd5e2973dce617f451e4eb07491b3a6874ea6ca47 (patch)
tree9e134ac8c0b263cec755068082ca61c9646efd21 /apps/web/components
parent91a9d3c1aee04d77b2a2d022821f4a7a38e315f3 (diff)
downloadkarakeep-d5e2973dce617f451e4eb07491b3a6874ea6ca47.tar.zst
chore: migrate away from eslint to oxlint (#1642)
* chore: migrate away from eslint to oxlint * revert turbo task name lint * it seems like we can remove the seemingly default globals
Diffstat (limited to 'apps/web/components')
-rw-r--r--apps/web/components/dashboard/bookmarks/EditorCard.tsx2
-rw-r--r--apps/web/components/dashboard/lists/EditListModal.tsx6
-rw-r--r--apps/web/components/dashboard/preview/HighlightsBox.tsx7
-rw-r--r--apps/web/components/settings/ApiKeySettings.tsx1
-rw-r--r--apps/web/components/settings/ImportExport.tsx2
-rw-r--r--apps/web/components/settings/UserDetails.tsx1
-rw-r--r--apps/web/components/shared/sidebar/MobileSidebar.tsx1
-rw-r--r--apps/web/components/shared/sidebar/Sidebar.tsx1
-rw-r--r--apps/web/components/ui/copy-button.tsx2
9 files changed, 16 insertions, 7 deletions
diff --git a/apps/web/components/dashboard/bookmarks/EditorCard.tsx b/apps/web/components/dashboard/bookmarks/EditorCard.tsx
index 75745bad..a5966845 100644
--- a/apps/web/components/dashboard/bookmarks/EditorCard.tsx
+++ b/apps/web/components/dashboard/bookmarks/EditorCard.tsx
@@ -132,7 +132,7 @@ export default function EditorCard({ className }: { className?: string }) {
if (!text.length) return;
try {
tryToImportUrls(text);
- } catch (e) {
+ } catch {
// Not a URL
mutate({ type: BookmarkTypes.TEXT, text });
}
diff --git a/apps/web/components/dashboard/lists/EditListModal.tsx b/apps/web/components/dashboard/lists/EditListModal.tsx
index 7a750c33..3b35e7d4 100644
--- a/apps/web/components/dashboard/lists/EditListModal.tsx
+++ b/apps/web/components/dashboard/lists/EditListModal.tsx
@@ -192,7 +192,11 @@ export function EditListModal({
(value: z.infer<typeof zNewBookmarkListSchema>) => {
value.parentId = value.parentId === "" ? null : value.parentId;
value.query = value.type === "smart" ? value.query : undefined;
- isEdit ? editList({ ...value, listId: list.id }) : createList(value);
+ if (isEdit) {
+ editList({ ...value, listId: list.id });
+ } else {
+ createList(value);
+ }
},
);
diff --git a/apps/web/components/dashboard/preview/HighlightsBox.tsx b/apps/web/components/dashboard/preview/HighlightsBox.tsx
index af065a9d..4da22d04 100644
--- a/apps/web/components/dashboard/preview/HighlightsBox.tsx
+++ b/apps/web/components/dashboard/preview/HighlightsBox.tsx
@@ -1,3 +1,4 @@
+import { Fragment } from "react";
import {
Collapsible,
CollapsibleContent,
@@ -28,10 +29,10 @@ export default function HighlightsBox({ bookmarkId }: { bookmarkId: string }) {
</CollapsibleTrigger>
<CollapsibleContent className="group flex flex-col py-3 text-sm">
{highlights.highlights.map((highlight) => (
- <>
- <HighlightCard key={highlight.id} highlight={highlight} clickable />
+ <Fragment key={highlight.id}>
+ <HighlightCard highlight={highlight} clickable />
<Separator className="m-2 h-0.5 bg-gray-200 last:hidden" />
- </>
+ </Fragment>
))}
</CollapsibleContent>
</Collapsible>
diff --git a/apps/web/components/settings/ApiKeySettings.tsx b/apps/web/components/settings/ApiKeySettings.tsx
index 8f07e5a4..2b9d19d1 100644
--- a/apps/web/components/settings/ApiKeySettings.tsx
+++ b/apps/web/components/settings/ApiKeySettings.tsx
@@ -13,6 +13,7 @@ import AddApiKey from "./AddApiKey";
import DeleteApiKey from "./DeleteApiKey";
export default async function ApiKeys() {
+ // oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
const keys = await api.apiKeys.list();
return (
diff --git a/apps/web/components/settings/ImportExport.tsx b/apps/web/components/settings/ImportExport.tsx
index 35c2b88f..3dde577b 100644
--- a/apps/web/components/settings/ImportExport.tsx
+++ b/apps/web/components/settings/ImportExport.tsx
@@ -282,7 +282,7 @@ export function ImportExportRow() {
};
});
return { status: "fulfilled" as const, value: created };
- } catch (e) {
+ } catch {
setImportProgress((prev) => {
const newDone = (prev?.done ?? 0) + 1;
return {
diff --git a/apps/web/components/settings/UserDetails.tsx b/apps/web/components/settings/UserDetails.tsx
index b86129c8..5b99c0ea 100644
--- a/apps/web/components/settings/UserDetails.tsx
+++ b/apps/web/components/settings/UserDetails.tsx
@@ -7,6 +7,7 @@ import { Card, CardContent, CardHeader, CardTitle } from "../ui/card";
import { Label } from "../ui/label";
export default async function UserDetails() {
+ // oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
const whoami = await api.users.whoami();
diff --git a/apps/web/components/shared/sidebar/MobileSidebar.tsx b/apps/web/components/shared/sidebar/MobileSidebar.tsx
index 15285a9e..c512a981 100644
--- a/apps/web/components/shared/sidebar/MobileSidebar.tsx
+++ b/apps/web/components/shared/sidebar/MobileSidebar.tsx
@@ -9,6 +9,7 @@ export default async function MobileSidebar({
}: {
items: (t: TFunction) => TSidebarItem[];
}) {
+ // oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
return (
<aside className="w-full overflow-x-auto">
diff --git a/apps/web/components/shared/sidebar/Sidebar.tsx b/apps/web/components/shared/sidebar/Sidebar.tsx
index dff26cdd..21d3ea48 100644
--- a/apps/web/components/shared/sidebar/Sidebar.tsx
+++ b/apps/web/components/shared/sidebar/Sidebar.tsx
@@ -14,6 +14,7 @@ export default async function Sidebar({
items: (t: TFunction) => TSidebarItem[];
extraSections?: React.ReactNode;
}) {
+ // oxlint-disable-next-line rules-of-hooks
const { t } = await useTranslation();
return (
diff --git a/apps/web/components/ui/copy-button.tsx b/apps/web/components/ui/copy-button.tsx
index 1cb405da..8d8699f8 100644
--- a/apps/web/components/ui/copy-button.tsx
+++ b/apps/web/components/ui/copy-button.tsx
@@ -54,7 +54,7 @@ export function CopyBtnV2({
await navigator.clipboard.writeText(url);
setCopied(true);
setTimeout(() => setCopied(false), 2000);
- } catch (err) {
+ } catch {
toast({
description:
"Failed to copy link. Browsers only support copying to the clipboard from https pages.",