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
@@ -1,6 +1,5 @@
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { error, redirect } from '@sveltejs/kit'
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
export function load({ params, url }) {
|
||||
if (Number(params.instance)) {
|
||||
|
||||
@@ -1,58 +1,35 @@
|
||||
<script lang="ts">
|
||||
import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte.js'
|
||||
import { isImage } from '$lib/ui/image.js'
|
||||
import { client, getClient } from '$lib/lemmy.svelte.js'
|
||||
import CommentForm from '$lib/components/lemmy/comment/CommentForm.svelte'
|
||||
import { onMount } from 'svelte'
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import { page } from '$app/state'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { mediaType } from '$lib/components/lemmy/post/helpers.js'
|
||||
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import PostActions from '$lib/components/lemmy/post/PostActions.svelte'
|
||||
import {
|
||||
ArrowLeft,
|
||||
ArrowPath,
|
||||
ChevronDoubleUp,
|
||||
Icon,
|
||||
InformationCircle,
|
||||
Home,
|
||||
PlusCircle,
|
||||
ChatBubbleLeftRight,
|
||||
Bookmark,
|
||||
BookmarkSlash,
|
||||
ArrowUp,
|
||||
ArrowDown,
|
||||
Fire,
|
||||
Trophy,
|
||||
Star,
|
||||
Clock,
|
||||
ArrowTrendingDown,
|
||||
ArrowRight,
|
||||
} from 'svelte-hero-icons'
|
||||
import PostMeta, {
|
||||
parseTags,
|
||||
} from '$lib/components/lemmy/post/PostMeta.svelte'
|
||||
import { Select, removeToast, toast } from 'mono-svelte'
|
||||
import type { CommentSortType, GetCommentsResponse } from 'lemmy-js-client'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { instance } from '$lib/instance.svelte.js'
|
||||
import { afterNavigate, goto } from '$app/navigation'
|
||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||
import { Button } from 'mono-svelte'
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { publishedToDate } from '$lib/components/util/date.js'
|
||||
import PostMedia from '$lib/components/lemmy/post/media/PostMedia.svelte'
|
||||
import { mediaType } from '$lib/components/lemmy/post/helpers.js'
|
||||
import Post from '$lib/components/lemmy/post/Post.svelte'
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import { Popover } from 'mono-svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { resumables } from '$lib/lemmy/item.js'
|
||||
import Placeholder from '$lib/components/ui/Placeholder.svelte'
|
||||
import CommentListVirtualizer from '$lib/components/lemmy/comment/CommentListVirtualizer.svelte'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import { fly } from 'svelte/transition'
|
||||
import { publishedToDate } from '$lib/components/util/date.js'
|
||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||
import { t } from '$lib/i18n/translations.js'
|
||||
import { getClient } from '$lib/lemmy.svelte.js'
|
||||
import { resumables } from '$lib/lemmy/item.js'
|
||||
import { settings } from '$lib/settings.svelte.js'
|
||||
import { isImage } from '$lib/ui/image.js'
|
||||
import { Button, toast } from 'mono-svelte'
|
||||
import { onMount } from 'svelte'
|
||||
import {
|
||||
ArrowLeft,
|
||||
ArrowRight,
|
||||
ChatBubbleLeftRight,
|
||||
ChevronDoubleUp,
|
||||
Icon,
|
||||
} from 'svelte-hero-icons'
|
||||
import { expoOut } from 'svelte/easing'
|
||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||
import { fly } from 'svelte/transition'
|
||||
import CommentProvider from './CommentProvider.svelte'
|
||||
|
||||
let { data } = $props()
|
||||
@@ -65,8 +42,6 @@
|
||||
getClient().markPostAsRead({
|
||||
read: settings.markPostsAsRead,
|
||||
post_ids: [data.post.value.post_view.post.id],
|
||||
// @ts-ignore
|
||||
post_id: data.post.value.post_view.post.id,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -78,7 +53,6 @@
|
||||
})
|
||||
})
|
||||
|
||||
let commentsPage = 1
|
||||
let loading = $state(false)
|
||||
|
||||
async function reloadComments() {
|
||||
@@ -93,7 +67,6 @@
|
||||
})
|
||||
loading = false
|
||||
data.thread.value.singleThread = false
|
||||
commentsPage = 1
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -218,7 +191,7 @@
|
||||
class="divide-y! divide-slate-200 dark:divide-zinc-800 flex flex-col"
|
||||
>
|
||||
{#key crossposts}
|
||||
{#each crossposts as crosspost}
|
||||
{#each crossposts as crosspost (crosspost.post.id)}
|
||||
<Post view="compact" post={crosspost} />
|
||||
{/each}
|
||||
{/key}
|
||||
@@ -270,7 +243,8 @@
|
||||
{/if}
|
||||
{#await data.comments.value}
|
||||
<div class="flex flex-col gap-4">
|
||||
{#each new Array(10) as empty, index}
|
||||
{#each new Array(10) as _, index}
|
||||
{_}
|
||||
<div
|
||||
in:fly|global={{
|
||||
duration: 500,
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||
import { client, getClient } from '$lib/lemmy.svelte.js'
|
||||
import { awaitIfServer } from '$lib/promise.svelte.js'
|
||||
import { SSR_ENABLED, settings } from '$lib/settings.svelte'
|
||||
import type { GetComments } from 'lemmy-js-client'
|
||||
import { ReactiveState } from '$lib/promise.svelte.js'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
import { resolveRoute } from '$app/paths'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||
import { client } from '$lib/lemmy.svelte.js'
|
||||
import { ReactiveState, awaitIfServer } from '$lib/promise.svelte.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { redirect } from '@sveltejs/kit'
|
||||
import type { GetComments } from 'lemmy-js-client'
|
||||
|
||||
function buildContext(thread?: string) {
|
||||
let parentId: number | undefined
|
||||
|
||||
@@ -6,14 +6,12 @@
|
||||
import Comments from '$lib/components/lemmy/comment/Comments.svelte'
|
||||
import { buildCommentsTree } from '$lib/components/lemmy/comment/comments.svelte'
|
||||
import EndPlaceholder from '$lib/components/ui/EndPlaceholder.svelte'
|
||||
import { instance } from '$lib/instance.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { instance } from '$lib/instance.svelte'
|
||||
import type {
|
||||
CommentSortType,
|
||||
GetCommentsResponse,
|
||||
GetPostResponse,
|
||||
PostView,
|
||||
} from 'lemmy-js-client'
|
||||
import { Button, Option, Select } from 'mono-svelte'
|
||||
import {
|
||||
@@ -87,14 +85,14 @@
|
||||
{:else}
|
||||
<CommentForm
|
||||
postId={post.post_view.post.id}
|
||||
oncomment={(comment) => {
|
||||
oncomment={comment => {
|
||||
comments.comments = [comment.comment_view, ...comments.comments]
|
||||
}}
|
||||
locked={(post.post_view.post.locked &&
|
||||
!(
|
||||
profile.data?.user?.local_user_view.local_user.admin ||
|
||||
profile.data?.user?.moderates
|
||||
.map((c) => c.community.id)
|
||||
.map(c => c.community.id)
|
||||
.includes(post.community_view.community.id)
|
||||
)) ||
|
||||
page.params.instance.toLowerCase() != instance.data.toLowerCase()}
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
</Header>
|
||||
<p>
|
||||
{$t('routes.postRedirect.description', {
|
||||
// @ts-ignore
|
||||
homeInstance: fetched,
|
||||
})}
|
||||
</p>
|
||||
@@ -65,7 +64,6 @@
|
||||
onclick={fetchOnHome}
|
||||
>
|
||||
{$t('routes.postRedirect.actions.fetch', {
|
||||
// @ts-ignore
|
||||
homeInstance: fetched,
|
||||
})}
|
||||
</Button>
|
||||
@@ -76,12 +74,11 @@
|
||||
</div>
|
||||
{#if profileData.profiles}
|
||||
{@const filtered = profileData.profiles.filter(
|
||||
(i) => i.instance == page.params.instance,
|
||||
i => i.instance == page.params.instance,
|
||||
)}
|
||||
<div class="space-y-1">
|
||||
<div class="font-medium text-sm">
|
||||
{$t('routes.postRedirect.actions.switch', {
|
||||
// @ts-ignore
|
||||
destInstance: page.params.instance,
|
||||
})}
|
||||
</div>
|
||||
@@ -91,7 +88,7 @@
|
||||
rounding="2xl"
|
||||
class="dark:bg-zinc-950 max-h-96 overflow-auto"
|
||||
>
|
||||
{#each filtered as profile, index}
|
||||
{#each filtered as profile, index (profile.id)}
|
||||
<ProfileButton prof={profile} {index} />
|
||||
{/each}
|
||||
<SidebarButton
|
||||
|
||||
Reference in new issue
Block a user