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:
Xylight authored and GitHub committed 2025-06-09 16:34:06 -07:00
1 parent 1824245f13
commit 76c581123a
225 files changed
+1553 -2352

No files matched your search

@@ -1,24 +1,21 @@
<script lang="ts">
import { run } from 'svelte/legacy'
import { browser } from '$app/environment'
import { tick } from 'svelte'
import type { HTMLTextareaAttributes } from 'svelte/elements'
let textarea: HTMLTextAreaElement | undefined = $state()
async function adjustHeight(value: string) {
async function adjustHeight() {
await tick()
if (textarea) {
textarea.style.height = 'auto' // Reset height to auto to calculate new height
textarea.style.height = `${textarea.scrollHeight}px` // Set height to the scrollHeight
}
}
interface Props {
interface Props extends HTMLTextareaAttributes {
label?: string | undefined
value: string
required?: boolean
class?: string
[key: string]: any
}
let {
@@ -29,8 +26,8 @@
...rest
}: Props = $props()
run(() => {
adjustHeight(value)
$effect(() => {
if (value) adjustHeight()
})
</script>
@@ -45,7 +42,7 @@
{/if}
<textarea
bind:this={textarea}
oninput={() => adjustHeight(value)}
oninput={() => adjustHeight()}
bind:value
{required}
{...rest}
+4 -3
View File
@@ -2,21 +2,22 @@
export const parseURL = (href: string) => {
try {
return new URL(href)
} catch (e) {
} catch {
return undefined
}
}
</script>
<script lang="ts">
interface Props {
import type { HTMLAnchorAttributes } from 'svelte/elements'
interface Props extends HTMLAnchorAttributes {
href: string
highlight?: boolean
nowrap?: boolean
children?: import('svelte').Snippet
class?: string
icon?: import('svelte').Snippet
[key: string]: any
}
let {
+2 -42
View File
@@ -1,6 +1,4 @@
<script lang="ts">
import { run, preventDefault } from 'svelte/legacy'
type T = $$Generic
interface Props {
@@ -8,10 +6,7 @@
disabled?: boolean[]
optionNames?: string[]
selected: T
headless?: boolean
class?: string
buttonClazz?: string
children?: import('svelte').Snippet<[any]>
children?: import('svelte').Snippet<[{ selected: T }]>
onselect?: (item: T) => void
}
@@ -20,9 +15,6 @@
disabled = [],
optionNames = [],
selected = $bindable(),
headless = false,
class: clazz = '',
buttonClazz = '',
children,
onselect,
}: Props = $props()
@@ -30,38 +22,6 @@
$effect(() => {
onselect?.(selected)
})
let containerClass = `
flex flex-row rtl:flex-row-reverse items-center w-max max-w-full overflow-auto
${headless ? 'pb-1 gap-1' : ''}
${clazz}
`
const buttonClass = (selected: boolean) => `
first:rounded-l-lg first:border-l dark:first:border-l-transparent
last:rounded-r-lg last:border-r dark:last:border-r-transparent
rounded-l-none
rounded-r-none
px-3 py-1.5 text-sm hover:brightness-110 ${buttonClazz || ''}
${
!selected
? `dark:hover:bg-zinc-800 border-slate-100 border-t border-b border-b-slate-300 dark:border-b-0
dark:border-t dark:border-t-zinc-700`
: ''
}
transition-all transition-filters rounded-full
${
selected
? headless
? ''
: `bg-primary-900 dark:bg-primary-100 text-slate-50 dark:text-zinc-900`
: headless
? ''
: 'bg-white dark:bg-zinc-800'
}
disabled:opacity-60 disabled:pointer-events-none whitespace-nowrap
relative
`
</script>
<div
@@ -76,7 +36,7 @@
? 'bg-primary-900 dark:bg-primary-100 text-slate-50 dark:text-zinc-900'
: 'dark:bg-zinc-900/50 bg-white',
]}
onclick={(e) => {
onclick={e => {
e.preventDefault()
selected = option
}}