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
@@ -21,8 +21,8 @@
|
||||
})
|
||||
|
||||
return block
|
||||
} catch (error) {
|
||||
toast({ content: error as any, type: 'error' })
|
||||
} catch (err) {
|
||||
toast({ content: errorMessage(err as string), type: 'error' })
|
||||
return !block
|
||||
}
|
||||
}
|
||||
@@ -36,8 +36,8 @@
|
||||
})
|
||||
removeToast(purgeToast)
|
||||
toast({ content: t.get('toast.purgedCommunity'), type: 'success' })
|
||||
} catch (e) {
|
||||
toast({ content: e as any, type: 'error' })
|
||||
} catch (err) {
|
||||
toast({ content: errorMessage(err as string), type: 'error' })
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,8 +59,8 @@
|
||||
content: `Successfully blocked that instance.`,
|
||||
type: 'success',
|
||||
})
|
||||
} catch (error) {
|
||||
toast({ content: error as any, type: 'error' })
|
||||
} catch (err) {
|
||||
toast({ content: errorMessage(err as string), type: 'error' })
|
||||
}
|
||||
}
|
||||
</script>
|
||||
@@ -73,43 +73,39 @@
|
||||
} from '$lib/components/lemmy/moderation/moderation.js'
|
||||
import Markdown from '$lib/components/markdown/Markdown.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import Entity from '$lib/components/ui/Entity.svelte'
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import StickyCard from '$lib/components/ui/StickyCard.svelte'
|
||||
import {
|
||||
Menu,
|
||||
MenuButton,
|
||||
Modal,
|
||||
removeToast,
|
||||
toast,
|
||||
modal,
|
||||
action,
|
||||
} from 'mono-svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { client, getClient } from '$lib/lemmy.svelte.js'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { fullCommunityName } from '$lib/util.svelte.js'
|
||||
import type { CommunityModeratorView, CommunityView } from 'lemmy-js-client'
|
||||
import { Button } from 'mono-svelte'
|
||||
import {
|
||||
action,
|
||||
Button,
|
||||
Menu,
|
||||
MenuButton,
|
||||
modal,
|
||||
removeToast,
|
||||
toast,
|
||||
} from 'mono-svelte'
|
||||
import {
|
||||
BuildingOffice2,
|
||||
Calendar,
|
||||
ChartBar,
|
||||
Check,
|
||||
Cog6Tooth,
|
||||
EllipsisHorizontal,
|
||||
Fire,
|
||||
Icon,
|
||||
InformationCircle,
|
||||
Newspaper,
|
||||
NoSymbol,
|
||||
Plus,
|
||||
} from 'svelte-hero-icons'
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import ShieldIcon from '../moderation/ShieldIcon.svelte'
|
||||
import ItemList from '../generic/ItemList.svelte'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import Entity from '$lib/components/ui/Entity.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
|
||||
let loading = $state({
|
||||
blocking: false,
|
||||
@@ -128,8 +124,8 @@
|
||||
community_id: community_view.community.id,
|
||||
follow: !subscribed,
|
||||
})
|
||||
} catch (error) {
|
||||
toast({ content: error as any, type: 'error' })
|
||||
} catch (err) {
|
||||
toast({ content: errorMessage(err as string), type: 'error' })
|
||||
}
|
||||
|
||||
community_view.subscribed = subscribed ? 'NotSubscribed' : 'Subscribed'
|
||||
@@ -219,7 +215,7 @@
|
||||
</span>
|
||||
{/snippet}
|
||||
<ItemList
|
||||
items={moderators.map((m) => ({
|
||||
items={moderators.map(m => ({
|
||||
id: m.moderator.id,
|
||||
name: m.moderator.name,
|
||||
url: userLink(m.moderator),
|
||||
|
||||
@@ -4,22 +4,27 @@
|
||||
import { goto } from '$app/navigation'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import MarkdownEditor from '$lib/components/markdown/MarkdownEditor.svelte'
|
||||
import { Badge, ImageInput, MenuButton, Switch, toast } from 'mono-svelte'
|
||||
import { client, getClient, site } from '$lib/lemmy.svelte.js'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { Button, Checkbox, TextInput } from 'mono-svelte'
|
||||
import { uploadImage } from '$lib/util.svelte.js'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import Header from '$lib/components/ui/layout/pages/Header.svelte'
|
||||
import ImagePreviewInput from '$lib/components/input/ImagePreviewInput.svelte'
|
||||
import Label from 'mono-svelte/forms/Label.svelte'
|
||||
import { DocumentPlus, GlobeAlt, Icon, MapPin, Plus } from 'svelte-hero-icons'
|
||||
import ImageUploadModal from '../modal/ImageUploadModal.svelte'
|
||||
import Select from 'mono-svelte/forms/select/Select.svelte'
|
||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||
import SectionTitle from '$lib/components/ui/SectionTitle.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { getClient, site } from '$lib/lemmy.svelte.js'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import {
|
||||
Badge,
|
||||
Button,
|
||||
MenuButton,
|
||||
Switch,
|
||||
TextInput,
|
||||
toast,
|
||||
} from 'mono-svelte'
|
||||
import Label from 'mono-svelte/forms/Label.svelte'
|
||||
import Option from 'mono-svelte/forms/select/Option.svelte'
|
||||
import Select from 'mono-svelte/forms/select/Select.svelte'
|
||||
import Material from 'mono-svelte/materials/Material.svelte'
|
||||
import Menu from 'mono-svelte/popover/Menu.svelte'
|
||||
import { DocumentPlus, GlobeAlt, Icon, MapPin, Plus } from 'svelte-hero-icons'
|
||||
import ImageUploadModal from '../modal/ImageUploadModal.svelte'
|
||||
import { errorMessage } from '$lib/lemmy/error'
|
||||
|
||||
interface Props {
|
||||
/**
|
||||
@@ -96,7 +101,7 @@
|
||||
|
||||
if (profile.data.user) {
|
||||
const c = profile.data.user.moderates
|
||||
.map((m) => m.community.id)
|
||||
.map(m => m.community.id)
|
||||
.indexOf(res.community_view.community.id)
|
||||
if (c != -1) {
|
||||
profile.data.user.moderates[c] = {
|
||||
@@ -127,7 +132,7 @@
|
||||
)
|
||||
} catch (err) {
|
||||
toast({
|
||||
content: err as any,
|
||||
content: errorMessage(err as string),
|
||||
type: 'error',
|
||||
})
|
||||
}
|
||||
@@ -184,7 +189,7 @@
|
||||
<ImageUploadModal
|
||||
bind:open={uploading.icon}
|
||||
multiple={false}
|
||||
onupload={(uploaded) => {
|
||||
onupload={uploaded => {
|
||||
uploading.icon = false
|
||||
formData.icon = uploaded[0]
|
||||
}}
|
||||
@@ -212,7 +217,7 @@
|
||||
<ImageUploadModal
|
||||
bind:open={uploading.banner}
|
||||
multiple={false}
|
||||
onupload={(uploaded) => {
|
||||
onupload={uploaded => {
|
||||
uploading.banner = false
|
||||
formData.banner = uploaded[0]
|
||||
}}
|
||||
@@ -249,7 +254,7 @@
|
||||
</Badge>
|
||||
</button>
|
||||
{/snippet}
|
||||
{#each site.data.all_languages.filter((l) => !formData.languages?.includes(l.id)) as language, index}
|
||||
{#each site.data.all_languages.filter(l => !formData.languages?.includes(l.id)) as language (language.id)}
|
||||
<MenuButton
|
||||
class="min-h-[16px] py-0"
|
||||
onclick={() => {
|
||||
@@ -263,9 +268,9 @@
|
||||
</MenuButton>
|
||||
{/each}
|
||||
</Menu>
|
||||
{#each formData.languages ?? [] as languageId, index}
|
||||
{#each formData.languages ?? [] as languageId, index (languageId)}
|
||||
{@const language = site.data.all_languages.find(
|
||||
(l) => l.id == languageId,
|
||||
l => l.id == languageId,
|
||||
)}
|
||||
<button
|
||||
type="button"
|
||||
|
||||
@@ -1,7 +1,12 @@
|
||||
<script lang="ts">
|
||||
import { profile } from '$lib/auth.svelte'
|
||||
import EntityHeader from '$lib/components/ui/EntityHeader.svelte'
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
||||
import { publishedToDate } from '$lib/components/util/date'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { fullCommunityName } from '$lib/util.svelte'
|
||||
import type {
|
||||
Community,
|
||||
@@ -9,28 +14,22 @@
|
||||
CommunityModeratorView,
|
||||
SubscribedType,
|
||||
} from 'lemmy-js-client'
|
||||
import { Button, toast, Menu, MenuButton, modal, action } from 'mono-svelte'
|
||||
import { action, Button, Menu, MenuButton, modal, toast } from 'mono-svelte'
|
||||
import {
|
||||
BuildingOffice2,
|
||||
Check,
|
||||
Cog6Tooth,
|
||||
Icon,
|
||||
EllipsisHorizontal,
|
||||
Plus,
|
||||
Newspaper,
|
||||
BuildingOffice2,
|
||||
Fire,
|
||||
Icon,
|
||||
Newspaper,
|
||||
NoSymbol,
|
||||
Plus,
|
||||
} from 'svelte-hero-icons'
|
||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
||||
import Expandable from '$lib/components/ui/Expandable.svelte'
|
||||
import ShieldIcon from '../moderation/ShieldIcon.svelte'
|
||||
import ItemList from '../generic/ItemList.svelte'
|
||||
import { userLink } from '$lib/lemmy/generic'
|
||||
import { formatRelativeDate } from '$lib/components/util/RelativeDate.svelte'
|
||||
import { publishedToDate } from '$lib/components/util/date'
|
||||
import { isAdmin } from '../moderation/moderation'
|
||||
import { block, blockInstance, purgeCommunity } from './CommunityCard.svelte'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
|
||||
interface Props {
|
||||
community: Community
|
||||
@@ -102,7 +101,7 @@
|
||||
<hr class="flex-1 border-slate-200 dark:border-zinc-800 mx-3" />
|
||||
{/snippet}
|
||||
<ItemList
|
||||
items={moderators.map((m) => ({
|
||||
items={moderators.map(m => ({
|
||||
id: m.moderator.id,
|
||||
name: m.moderator.name,
|
||||
url: userLink(m.moderator),
|
||||
@@ -119,8 +118,7 @@
|
||||
community: community,
|
||||
banned_from_community: false,
|
||||
blocked: false,
|
||||
// @ts-ignore
|
||||
counts: counts ?? {},
|
||||
counts: counts!,
|
||||
subscribed: subscribed,
|
||||
}}
|
||||
>
|
||||
@@ -153,7 +151,7 @@
|
||||
{/if}
|
||||
|
||||
{#if profile.data?.user && profile.data.user.moderates
|
||||
.map((c) => c.community.id)
|
||||
.map(c => c.community.id)
|
||||
.includes(community.id)}
|
||||
<Button
|
||||
size="square-lg"
|
||||
|
||||
@@ -1,29 +1,25 @@
|
||||
<script lang="ts">
|
||||
import CommunityLink from '$lib/components/lemmy/community/CommunityLink.svelte'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import { fullCommunityName, isSubscribed } from '$lib/util.svelte.js'
|
||||
import type { CommunityView } from 'lemmy-js-client'
|
||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
||||
import { Button, Modal } from 'mono-svelte'
|
||||
import {
|
||||
ChatBubbleOvalLeftEllipsis,
|
||||
Check,
|
||||
ExclamationTriangle,
|
||||
Icon,
|
||||
InformationCircle,
|
||||
MapPin,
|
||||
NoSymbol,
|
||||
PencilSquare,
|
||||
Plus,
|
||||
Trash,
|
||||
UserGroup,
|
||||
} from 'svelte-hero-icons'
|
||||
import FormattedNumber from '$lib/components/util/FormattedNumber.svelte'
|
||||
import { Button, Modal } from 'mono-svelte'
|
||||
import { fullCommunityName, isSubscribed } from '$lib/util.svelte.js'
|
||||
import { profile } from '$lib/auth.svelte.js'
|
||||
import { addSubscription } from '$lib/lemmy/user.js'
|
||||
import Avatar from '$lib/components/ui/Avatar.svelte'
|
||||
import CommunityCard from '$lib/components/lemmy/community/CommunityCard.svelte'
|
||||
import LabelStat from '$lib/components/ui/LabelStat.svelte'
|
||||
import { t } from '$lib/i18n/translations'
|
||||
import Subscribe from '../../../../routes/communities/Subscribe.svelte'
|
||||
|
||||
let showInfo = $state(false)
|
||||
interface Props {
|
||||
|
||||
@@ -13,10 +13,11 @@
|
||||
avatarSize?: number
|
||||
showInstance?: boolean
|
||||
displayName?: boolean
|
||||
badges?: any
|
||||
badges?: {
|
||||
nsfw: boolean
|
||||
}
|
||||
class?: string
|
||||
instanceClass?: string
|
||||
[key: string]: any
|
||||
}
|
||||
|
||||
let {
|
||||
|
||||
Reference in new issue
Block a user