fix: Fix lint errors (#559)
* cleanup: postactions styling * misc: fix first round of errors * pkg: remove vitest * fix: fix lint errors stage 2 * fix: fix lint errors stage 3 * fix: fix lint errors, stage 3 * misc: update eslint rules to warn for writable derived
This commit is contained in:
1 parent
1824245f13
commit
76c581123a
225 files changed
+1553
-2352
No files matched your search
@@ -2,9 +2,9 @@ import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||
import { getClient } from '$lib/lemmy.svelte.js'
|
||||
import { ReactiveState } from '$lib/promise.svelte'
|
||||
|
||||
export async function load(req: any) {
|
||||
const community = await getClient(undefined, req.fetch).getCommunity({
|
||||
name: req.params.name,
|
||||
export async function load({ fetch, params }) {
|
||||
const community = await getClient(undefined, fetch).getCommunity({
|
||||
name: params.name,
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -1,25 +1,23 @@
|
||||
<script lang="ts">
|
||||
import { run } from 'svelte/legacy'
|
||||
|
||||
import { browser } from '$app/environment'
|
||||
import { navigating, page } from '$app/state'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||
import CommunityHeader from '$lib/components/lemmy/community/CommunityHeader.svelte'
|
||||
import Sort from '$lib/components/lemmy/dropdowns/Sort.svelte'
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
import { setSessionStorage } from '$lib/session.js'
|
||||
import PostFeed from '$lib/components/lemmy/post/feed/PostFeed.svelte'
|
||||
import VirtualFeed from '$lib/components/lemmy/post/feed/VirtualFeed.svelte'
|
||||
import { Badge, Button, Modal, Note, toast } from 'mono-svelte'
|
||||
import { browser } from '$app/environment'
|
||||
import { ArrowRight, ChartBar, Icon, Plus, XMark } from 'svelte-hero-icons'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import Pageination from '$lib/components/ui/Pageination.svelte'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { site } from '$lib/lemmy.svelte.js'
|
||||
import { resumables } from '$lib/lemmy/item'
|
||||
import CommunityHeader from '$lib/components/lemmy/community/CommunityHeader.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { setSessionStorage } from '$lib/session.js'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { Badge, Button, Modal, Note } from 'mono-svelte'
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
import { ArrowRight, ChartBar, Icon, Plus, XMark } from 'svelte-hero-icons'
|
||||
|
||||
let { data } = $props()
|
||||
|
||||
@@ -81,9 +79,9 @@
|
||||
</Header>
|
||||
|
||||
{#if profile.data.user}
|
||||
{#if !data.community.value.discussion_languages.every( (l) => profile.data.user?.discussion_languages.includes(l), ) && profile.data.user.discussion_languages.length > 0}
|
||||
{#if !data.community.value.discussion_languages.every( l => profile.data.user?.discussion_languages.includes(l), ) && profile.data.user.discussion_languages.length > 0}
|
||||
{@const missing = data.community.value.discussion_languages.filter(
|
||||
(i) => !profile.data.user?.discussion_languages.includes(i),
|
||||
i => !profile.data.user?.discussion_languages.includes(i),
|
||||
)}
|
||||
<Note class="p-1! pl-3! flex-col md:flex-row">
|
||||
<div>{$t('routes.community.languageWarning')}</div>
|
||||
@@ -103,11 +101,11 @@
|
||||
<div class="flex flex-row gap-4 flex-wrap -mt-2">
|
||||
{#if site.data?.all_languages}
|
||||
{@const allLanguages = site.data.all_languages}
|
||||
{#each missing as language}
|
||||
{#each missing as language (language)}
|
||||
<a href="/profile/settings#languages" class="inline-block w-max">
|
||||
<Badge color="blue-subtle">
|
||||
<Icon src={Plus} size="16" micro />
|
||||
{allLanguages.find((i) => language == i.id)?.name}
|
||||
{allLanguages.find(i => language == i.id)?.name}
|
||||
</Badge>
|
||||
</a>
|
||||
{/each}
|
||||
@@ -146,13 +144,12 @@
|
||||
<Pageination
|
||||
page={data.page}
|
||||
cursor={{ next: data.cursor.next }}
|
||||
href={(page) =>
|
||||
href={page =>
|
||||
typeof page == 'number' ? `?page=${page}` : `?cursor=${page}`}
|
||||
>
|
||||
<span class="flex flex-row items-center gap-1">
|
||||
<Icon src={ChartBar} size="16" mini />
|
||||
{$t('routes.frontpage.footer', {
|
||||
// @ts-ignore
|
||||
users: site.data?.site_view.counts.users_active_day ?? '??',
|
||||
})}
|
||||
</span>
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
import { postFeed } from '$lib/lemmy/postfeed.svelte.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import type { SortType } from 'lemmy-js-client'
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
export async function load({ params, fetch, url }) {
|
||||
const cursor: string | undefined = url.searchParams.get('cursor') as
|
||||
|
||||
@@ -32,8 +32,6 @@
|
||||
languages: data.community.value.discussion_languages,
|
||||
}}
|
||||
>
|
||||
{#snippet formtitle()}
|
||||
{''}
|
||||
{/snippet}
|
||||
{#snippet formtitle()}{/snippet}
|
||||
</CommunityForm>
|
||||
</div>
|
||||
@@ -1,15 +1,15 @@
|
||||
<script lang="ts">
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import UserLink from '$lib/components/lemmy/user/UserLink.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import { Icon, Plus, Trash } from 'svelte-hero-icons'
|
||||
import type { PageData } from './$types.js'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { toast } from 'mono-svelte'
|
||||
import { client, getClient } from '$lib/lemmy.svelte.js'
|
||||
import { flip } from 'svelte/animate'
|
||||
import { Button, TextInput } from 'mono-svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient } from '$lib/lemmy.svelte.js'
|
||||
import { Button, TextInput, toast } from 'mono-svelte'
|
||||
import { Icon, Plus, Trash } from 'svelte-hero-icons'
|
||||
import { flip } from 'svelte/animate'
|
||||
import type { PageData } from './$types.js'
|
||||
import { errorMessage } from '$lib/lemmy/error.js'
|
||||
|
||||
interface Props {
|
||||
data: PageData
|
||||
@@ -71,7 +71,7 @@
|
||||
}
|
||||
} catch (err) {
|
||||
toast({
|
||||
content: err as any,
|
||||
content: errorMessage(err as string),
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
@@ -97,7 +97,7 @@
|
||||
})
|
||||
} catch (err) {
|
||||
toast({
|
||||
content: err as any,
|
||||
content: errorMessage(err as string),
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
@@ -139,7 +139,7 @@
|
||||
{/each}
|
||||
</ul>
|
||||
<form
|
||||
onsubmit={(e) => {
|
||||
onsubmit={e => {
|
||||
e.preventDefault()
|
||||
addModerator()
|
||||
}}
|
||||
|
||||
Reference in new issue
Block a user