Skip to content

Update dependency @biomejs/biome to v2 #1191

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions biome.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
{
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"$schema": "https://biomejs.dev/schemas/2.0.4/schema.json",
"vcs": {
"enabled": false,
"clientKind": "git",
"useIgnoreFile": false
},
"files": {
"ignoreUnknown": false,
"ignore": []
"ignoreUnknown": false
},
"formatter": {
"enabled": true,
"indentStyle": "space"
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
Expand All @@ -26,5 +22,13 @@
"formatter": {
"quoteStyle": "double"
}
},
"assist": {
"enabled": true,
"actions": {
"source": {
"organizeImports": "on"
}
}
}
}
4 changes: 2 additions & 2 deletions client/components/AiResponse/AiResponseContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
} from "@tabler/icons-react";
import type { PublishFunction } from "create-pubsub";
import { usePubSub } from "create-pubsub/react";
import { type ReactNode, Suspense, lazy, useMemo, useState } from "react";
import { lazy, type ReactNode, Suspense, useMemo, useState } from "react";
import { addLogEntry } from "../../modules/logEntries";
import { settingsPubSub } from "../../modules/pubSub";
import { searchAndRespond } from "../../modules/textGeneration";
Expand Down Expand Up @@ -81,7 +81,7 @@ export default function AiResponseContent({
/\[([^\]]+)\]\([^)]+\)/g,
"($1)",
);
const withoutMarkdown = withoutLinks.replace(/[#*`_~\[\]]/g, "");
const withoutMarkdown = withoutLinks.replace(/[#*`_~[\]]/g, "");
return withoutMarkdown.trim();
};

Expand Down
2 changes: 1 addition & 1 deletion client/components/AiResponse/AiResponseSection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { CodeHighlightAdapterProvider } from "@mantine/code-highlight";
import { usePubSub } from "create-pubsub/react";
import { Suspense, lazy, useMemo } from "react";
import { lazy, Suspense, useMemo } from "react";
import {
modelLoadingProgressPubSub,
modelSizeInMegabytesPubSub,
Expand Down
2 changes: 1 addition & 1 deletion client/components/AiResponse/ChatHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Group, Text } from "@mantine/core";
import type { ChatMessage } from "gpt-tokenizer/GptEncoding";
import { Suspense, lazy } from "react";
import { lazy, Suspense } from "react";

const CopyIconButton = lazy(() => import("./CopyIconButton"));

Expand Down
2 changes: 1 addition & 1 deletion client/components/AiResponse/ChatInputArea.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Button, Group, Textarea } from "@mantine/core";
import { usePubSub } from "create-pubsub/react";
import { Suspense, lazy } from "react";
import { lazy, Suspense } from "react";
import {
chatGenerationStatePubSub,
chatInputPubSub,
Expand Down
4 changes: 2 additions & 2 deletions client/components/AiResponse/ChatInterface.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ import { usePubSub } from "create-pubsub/react";
import type { ChatMessage } from "gpt-tokenizer/GptEncoding";
import {
type KeyboardEvent,
Suspense,
lazy,
Suspense,
useCallback,
useEffect,
useState,
Expand Down Expand Up @@ -84,7 +84,7 @@ export default function ChatInterface({
isGeneratingResponse: false,
isGeneratingFollowUpQuestion: false,
});
} catch (error) {
} catch (_) {
setFollowUpQuestion("");
setGenerationState({
isGeneratingResponse: false,
Expand Down
2 changes: 1 addition & 1 deletion client/components/AiResponse/ExpandableLink.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from "@mantine/core";
import type { MantineTheme } from "@mantine/core";
import { Button } from "@mantine/core";
import React from "react";

interface ExpandableLinkProps {
Expand Down
6 changes: 3 additions & 3 deletions client/components/AiResponse/FormattedMarkdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@ export default function FormattedMarkdown({
className = "",
enableCopy = true,
}: FormattedMarkdownProps) {
const { reasoningContent, mainContent, isGenerating } =
useReasoningContent(children);

if (!children) {
return null;
}

const { reasoningContent, mainContent, isGenerating } =
useReasoningContent(children);

return (
<TypographyStylesProvider p="lg">
{reasoningContent && (
Expand Down
2 changes: 1 addition & 1 deletion client/components/AiResponse/MessageList.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Paper, Stack } from "@mantine/core";
import type { ChatMessage } from "gpt-tokenizer/GptEncoding";
import { Suspense, lazy, memo } from "react";
import { lazy, memo, Suspense } from "react";

const FormattedMarkdown = lazy(() => import("./FormattedMarkdown"));

Expand Down
2 changes: 1 addition & 1 deletion client/components/Logs/ShowLogsButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button, Center, Loader, Stack, Text } from "@mantine/core";
import { Suspense, lazy, useState } from "react";
import { lazy, Suspense, useState } from "react";
import { addLogEntry } from "../../modules/logEntries";

const LogsModal = lazy(() => import("./LogsModal"));
Expand Down
3 changes: 1 addition & 2 deletions client/components/Pages/Main/MainPage.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import { Center, Container, Loader, Stack } from "@mantine/core";
import { usePubSub } from "create-pubsub/react";
import { Suspense } from "react";
import { lazy } from "react";
import { lazy, Suspense } from "react";
import {
imageSearchStatePubSub,
queryPubSub,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { NumberInput, Skeleton, Switch } from "@mantine/core";
import type { UseFormReturnType } from "@mantine/form";
import { Suspense, lazy } from "react";
import { lazy, Suspense } from "react";
import type { defaultSettings } from "../../../../../../modules/settings";

const WebLlmModelSelect = lazy(
Expand Down
2 changes: 1 addition & 1 deletion client/components/Pages/Main/Menu/ActionsForm.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Stack } from "@mantine/core";
import { Suspense, lazy } from "react";
import { lazy, Suspense } from "react";

const ClearDataButton = lazy(() => import("./ClearDataButton"));
const ShowLogsButton = lazy(() => import("../../../Logs/ShowLogsButton"));
Expand Down
2 changes: 1 addition & 1 deletion client/components/Pages/Main/Menu/MenuButton.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Button } from "@mantine/core";
import { Suspense, lazy, useCallback, useEffect, useState } from "react";
import { lazy, Suspense, useCallback, useEffect, useState } from "react";
import { addLogEntry } from "../../../../modules/logEntries";

const MenuDrawer = lazy(() => import("./MenuDrawer"));
Expand Down
5 changes: 2 additions & 3 deletions client/components/Pages/Main/Menu/MenuDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import {
import { IconBrandGithub } from "@tabler/icons-react";
import { usePubSub } from "create-pubsub/react";
import prettyMilliseconds from "pretty-ms";
import { Suspense, lazy } from "react";
import { lazy, Suspense } from "react";
import { repository } from "../../../../../package.json";
import { appName, appVersion } from "../../../../modules/appInfo";
import { addLogEntry } from "../../../../modules/logEntries";
Expand Down Expand Up @@ -57,8 +57,7 @@ export default function MenuDrawer(drawerProps: DrawerProps) {
<Center>
Released{" "}
{prettyMilliseconds(
new Date().getTime() -
new Date(VITE_BUILD_DATE_TIME).getTime(),
Date.now() - new Date(VITE_BUILD_DATE_TIME).getTime(),
{
compact: true,
verbose: true,
Expand Down
4 changes: 2 additions & 2 deletions client/components/Search/Form/SearchForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default function SearchForm({
const fetchQuerySuggestion = useCallback(async () => {
try {
return await getRandomQuerySuggestion();
} catch (error) {
} catch (_) {
addLogEntry("Failed to get query suggestion");
return defaultSuggestedQuery;
}
Expand All @@ -74,7 +74,7 @@ export default function SearchForm({
try {
const suggestion = await getRandomQuerySuggestion();
setState((prev) => ({ ...prev, suggestedQuery: suggestion }));
} catch (error) {
} catch (_) {
addLogEntry("Failed to get query suggestion");
setState((prev) => ({
...prev,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Carousel } from "@mantine/carousel";
import { Button, Group, Stack, Text, Transition, rem } from "@mantine/core";
import { Button, Group, rem, Stack, Text, Transition } from "@mantine/core";
import { useEffect, useState } from "react";
import type { ImageSearchResult } from "../../../../modules/types";
import "@mantine/carousel/styles.css";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { AspectRatio, Group, Skeleton } from "@mantine/core";
import { em } from "@mantine/core";
import { AspectRatio, em, Group, Skeleton } from "@mantine/core";
import { useMediaQuery } from "@mantine/hooks";

export default function ImageResultsLoadingState() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Alert } from "@mantine/core";
import { IconInfoCircle } from "@tabler/icons-react";
import { usePubSub } from "create-pubsub/react";
import { Suspense, lazy } from "react";
import { lazy, Suspense } from "react";
import {
imageSearchResultsPubSub,
imageSearchStatePubSub,
Expand Down
2 changes: 1 addition & 1 deletion client/components/Search/Results/SearchResultsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Alert, Loader, Stack, Text } from "@mantine/core";
import { usePubSub } from "create-pubsub/react";
import { Suspense, lazy } from "react";
import { lazy, Suspense } from "react";
import { ErrorBoundary } from "react-error-boundary";
import { settingsPubSub } from "../../../modules/pubSub";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import {
Box,
em,
Flex,
Stack,
Text,
Tooltip,
Transition,
UnstyledButton,
em,
} from "@mantine/core";
import { useMediaQuery } from "@mantine/hooks";
import { useEffect, useState } from "react";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Alert } from "@mantine/core";
import { IconInfoCircle } from "@tabler/icons-react";
import { usePubSub } from "create-pubsub/react";
import { Suspense, lazy } from "react";
import { lazy, Suspense } from "react";
import {
textSearchResultsPubSub,
textSearchStatePubSub,
Expand Down
2 changes: 1 addition & 1 deletion client/modules/searchTokenHash.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { argon2Verify, argon2id } from "hash-wasm";
import { argon2id, argon2Verify } from "hash-wasm";
import { addLogEntry } from "./logEntries";
import { getLastSearchTokenHash, updateLastSearchTokenHash } from "./pubSub";

Expand Down
4 changes: 2 additions & 2 deletions client/modules/textGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export async function searchAndRespond() {

if (!getSettings().enableAiResponse) return;

const responseGenerationStartTime = new Date().getTime();
const responseGenerationStartTime = Date.now();

try {
const settings = getSettings();
Expand Down Expand Up @@ -87,7 +87,7 @@ export async function searchAndRespond() {

addLogEntry(
`Response generation took ${prettyMilliseconds(
new Date().getTime() - responseGenerationStartTime,
Date.now() - responseGenerationStartTime,
{ verbose: true },
)}`,
);
Expand Down
Loading