Skip to content

Commit e2d2559

Browse files
committed
Fix ESLint errors
- Remove unused goto import in NavMenu.svelte - Remove unused imports and worker variable in MarkdownRenderer.svelte - Replace any types with string | boolean in settings.ts - Preserve _countSingleDollarSigns with eslint-disable comment
1 parent 667f582 commit e2d2559

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

src/lib/components/NavMenu.svelte

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
import { page } from "$app/state";
2525
import InfiniteScroll from "./InfiniteScroll.svelte";
2626
import { CONV_NUM_PER_PAGE } from "$lib/constants/pagination";
27-
import { goto } from "$app/navigation";
2827
import { browser } from "$app/environment";
2928
import { usePublicConfig } from "$lib/utils/PublicConfig.svelte";
3029
import { useAPIClient, handleResponse } from "$lib/APIClient";

src/lib/components/chat/MarkdownRenderer.svelte

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import { processBlocks, processBlocksSync, type BlockToken } from "$lib/utils/marked";
33
// import MarkdownWorker from "$lib/workers/markdownWorker?worker";
44
import MarkdownBlock from "./MarkdownBlock.svelte";
5-
import type { IncomingMessage, OutgoingMessage } from "$lib/workers/markdownWorker";
65
import { browser } from "$app/environment";
76
87
import DOMPurify from "isomorphic-dompurify";
@@ -15,8 +14,6 @@
1514
loading?: boolean;
1615
}
1716
18-
let worker: Worker | null = null;
19-
2017
let { content, sources = [], loading = false }: Props = $props();
2118
2219
let blocks: BlockToken[] = $state(processBlocksSync(content, sources));

src/lib/stores/settings.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ type SettingsStoreWritable = Writable<SettingsStore> & {
2323
initValue: <K extends keyof SettingsStore>(
2424
key: K,
2525
nestedKey: string,
26-
value: any
26+
value: string | boolean
2727
) => Promise<void>;
2828
};
2929

@@ -77,9 +77,13 @@ export function createSettingsStore(initialValue: Omit<SettingsStore, "recentlyS
7777
}
7878
}
7979

80-
async function initValue<K extends keyof SettingsStore>(key: K, nestedKey: string, value: any) {
80+
async function initValue<K extends keyof SettingsStore>(
81+
key: K,
82+
nestedKey: string,
83+
value: string | boolean
84+
) {
8185
const currentStore = get(baseStore);
82-
const currentNestedObject = currentStore[key] as Record<string, any>;
86+
const currentNestedObject = currentStore[key] as Record<string, string | boolean>;
8387

8488
// Only initialize if undefined
8589
if (currentNestedObject?.[nestedKey] !== undefined) {

src/lib/utils/parseIncompleteMarkdown.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,6 +451,7 @@ const handleIncompleteStrikethrough = (text: string): string => {
451451
};
452452

453453
// Counts single dollar signs that are not part of double dollar signs and not escaped
454+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
454455
const _countSingleDollarSigns = (text: string): number => {
455456
return text.split("").reduce((acc, char, index) => {
456457
if (char === "$") {

0 commit comments

Comments
 (0)