.prettierrc.json was missing "semi": false, so prettier wanted to add semicolons to a codebase written without them (763 semicolon-free statements vs. 150 with, in hand-written .ts; zero hand-written .svelte files use them at all). That's why prettier --check failed on 249 files — not because the code was unformatted, but because the config didn't match the actual house style. Added "semi": false; left printWidth/etc as configured (printWidth barely moves the failure count: 218/213/212 files at 100/120/140). Ran `prettier --write .` with the corrected config. Verified semantics-preserving before and after: - eslint: 142 problems both before and after, byte-identical - build passes, 38/38 tests pass - token-stream diff (whitespace/semicolons/quotes normalized) on all 218 changed files: only 52 had any remaining token change, all either trailing-comma removal (matching trailingComma: "none") or import/ ternary reflow — no semantic changes - live smoke test: Knowledge, Tasks, Fleet map, and a chat window (AgentTrace, markdown, Scope graph, activity rail) all render correctly, no console errors Most of the diff is shadcn/ui vendor files (lib/components/ui/) moving from the CLI's own style (double quotes, tabs, semicolons) to house style; re-running `shadcn-svelte add` on a component will need a follow-up format pass. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
49 lines
2.1 KiB
Svelte
49 lines
2.1 KiB
Svelte
<script lang="ts">
|
|
import type { HTMLInputAttributes, HTMLInputTypeAttribute } from 'svelte/elements'
|
|
import { cn, type WithElementRef } from '$lib/utils.js'
|
|
|
|
type InputType = Exclude<HTMLInputTypeAttribute, 'file'>
|
|
|
|
type Props = WithElementRef<
|
|
Omit<HTMLInputAttributes, 'type'> &
|
|
({ type: 'file'; files?: FileList } | { type?: InputType; files?: undefined })
|
|
>
|
|
|
|
let {
|
|
ref = $bindable(null),
|
|
value = $bindable(),
|
|
type,
|
|
files = $bindable(),
|
|
class: className,
|
|
'data-slot': dataSlot = 'input',
|
|
...restProps
|
|
}: Props = $props()
|
|
</script>
|
|
|
|
{#if type === 'file'}
|
|
<input
|
|
bind:this={ref}
|
|
data-slot={dataSlot}
|
|
class={cn(
|
|
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
className
|
|
)}
|
|
type="file"
|
|
bind:files
|
|
bind:value
|
|
{...restProps}
|
|
/>
|
|
{:else}
|
|
<input
|
|
bind:this={ref}
|
|
data-slot={dataSlot}
|
|
class={cn(
|
|
'dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-9 rounded-md border bg-transparent px-2.5 py-1 text-base shadow-xs transition-[color,box-shadow] file:h-7 file:text-sm file:font-medium focus-visible:ring-3 aria-invalid:ring-3 md:text-sm file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50',
|
|
className
|
|
)}
|
|
{type}
|
|
bind:value
|
|
{...restProps}
|
|
/>
|
|
{/if}
|