From deeb7c58cf1ecdfc50f9ccc2153a29aaa7cd7f84 Mon Sep 17 00:00:00 2001 From: Untone Date: Fri, 28 Jun 2024 18:26:00 +0300 Subject: [PATCH] linted --- src/components/Views/AllTopics/AllTopics.tsx | 8 +++++--- src/context/topics.tsx | 1 - src/routes/topics.tsx | 4 ++-- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/components/Views/AllTopics/AllTopics.tsx b/src/components/Views/AllTopics/AllTopics.tsx index dd1bcb29..df91d57d 100644 --- a/src/components/Views/AllTopics/AllTopics.tsx +++ b/src/components/Views/AllTopics/AllTopics.tsx @@ -30,8 +30,8 @@ export const AllTopics = (props: Props) => { const alphabet = createMemo(() => ABC[lang()]) const { setTopicsSort, sortedTopics } = useTopics() const topics = createMemo(() => sortedTopics() || props.topics) - const [searchParams, ] = useSearchParams<{ by?: string }>() - createEffect(on(() => searchParams?.by || 'shouts', setTopicsSort, {defer: true})) + const [searchParams] = useSearchParams<{ by?: string }>() + createEffect(on(() => searchParams?.by || 'shouts', setTopicsSort, { defer: true })) onMount(() => setTopicsSort('shouts')) // sorted derivative const byLetter = createMemo<{ [letter: string]: Topic[] }>(() => { @@ -66,7 +66,9 @@ export const AllTopics = (props: Props) => { // filter const [searchQuery, setSearchQuery] = createSignal('') const [filteredResults, setFilteredResults] = createSignal([]) - createEffect(() => setFilteredResults((_prev: Topic[]) => dummyFilter(topics(), searchQuery(), lang()) as Topic[])) + createEffect(() => + setFilteredResults((_prev: Topic[]) => dummyFilter(topics(), searchQuery(), lang()) as Topic[]) + ) // subcomponent const AllTopicsHead = () => ( diff --git a/src/context/topics.tsx b/src/context/topics.tsx index 7099421b..e94c6fdf 100644 --- a/src/context/topics.tsx +++ b/src/context/topics.tsx @@ -1,4 +1,3 @@ -import { createLazyMemo } from '@solid-primitives/memo' import { openDB } from 'idb' import { Accessor, diff --git a/src/routes/topics.tsx b/src/routes/topics.tsx index f13d6bb5..2796d911 100644 --- a/src/routes/topics.tsx +++ b/src/routes/topics.tsx @@ -1,5 +1,5 @@ import { type RouteDefinition, type RouteSectionProps, createAsync } from '@solidjs/router' -import { Suspense, createEffect} from 'solid-js' +import { Suspense, createEffect } from 'solid-js' import { useTopics } from '~/context/topics' import { Topic } from '~/graphql/schema/core.gen' import { loadTopics } from '~/lib/api' @@ -20,7 +20,7 @@ export default function AllTopicsPage(props: RouteSectionProps<{ topics: Topic[] const { t } = useLocalize() const topics = createAsync(async () => props.data.topics || (await fetchData()) || []) const { addTopics } = useTopics() - createEffect(() => addTopics(topics()||[])) + createEffect(() => addTopics(topics() || [])) return (