Skip to content
This repository was archived by the owner on Feb 17, 2025. It is now read-only.

Commit ba68996

Browse files
committed
Fix lint issues
1 parent 521dc78 commit ba68996

16 files changed

+31
-36
lines changed

src/ui/blocks/Dropfile.vue

+4
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,10 @@ function triggerFileInput() {
7070
@dragover="handleDragOver"
7171
@dragleave="handleDragLeave"
7272
@drop="handleDrop"
73+
role="button"
74+
aria-label="Upload files"
75+
tabindex="0"
76+
@keydown.enter="triggerFileInput"
7377
>
7478
<Upload class="size-12 text-slate-300" />
7579
<input

src/ui/blocks/FileItem.vue

+1-7
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,12 @@ function cancelItem(index: number) {
2828
}
2929
3030
function formatNumber(number: number): number {
31-
// Check if progress is a valid number, otherwise default to 0
3231
if (isNaN(number) || number === null || number === undefined) {
3332
return 0;
3433
}
3534
36-
// Ensure number is a positive value
3735
const positiveProgress = Math.max(0, number);
38-
39-
// Round to the nearest whole number
4036
const roundedProgress = Math.round(positiveProgress);
41-
42-
// Cap the value at 100
4337
const percentage = Math.min(roundedProgress, 100);
4438
4539
return percentage;
@@ -76,7 +70,7 @@ function extractFileName(filename: string): string {
7670
</p>
7771
</div>
7872
<div class="mt-1.5 flex items-center gap-x-2">
79-
<Progress v-model="progress" class="w-60" />
73+
<Progress v-model="progress" class="w-60" aria-label="Conversion progress" />
8074
<span class="text-xs">{{ `${progress === undefined ? 0 : progress}%` }}</span>
8175
</div>
8276
</div>

src/ui/components/combobox/Combobox.vue

+8-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,13 @@ function setOption(event: CustomEvent) {
3333
<Popover v-model:open="open">
3434
<PopoverTrigger as-child>
3535
<div class="p-1 rounded-lg bg-muted">
36-
<Button variant="secondary" role="combobox" :aria-expanded="open" class="justify-between shadow-none">
36+
<Button
37+
variant="secondary"
38+
role="combobox"
39+
:aria-expanded="open"
40+
:aria-controls="listId"
41+
class="justify-between shadow-none"
42+
>
3743
<span v-if="value" class="mr-2 text-foreground text-xs">{{ t('formats.convertsTo') }}: </span>
3844
<Badge v-if="value" class="rounded-sm">
3945
{{ options.find((option: string) => option === value) }}
@@ -47,7 +53,7 @@ function setOption(event: CustomEvent) {
4753
<Command v-model="value">
4854
<CommandInput :placeholder="`${t('formats.search')}...`" />
4955
<CommandEmpty>{{ t('formats.empty') }}</CommandEmpty>
50-
<CommandList>
56+
<CommandList :id="listId">
5157
<CommandGroup>
5258
<CommandItem v-for="(option, index) in options" :key="index" :value="option" @select="setOption">
5359
<Check :class="cn('mr-2 h-4 w-4', value === option ? 'opacity-100' : 'opacity-0')" />

src/ui/components/dialog/DialogContent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
3535
cn(
3636
'fixed left-1/2 top-1/2 z-50 grid w-full max-w-lg -translate-x-1/2 -translate-y-1/2 gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg',
3737
props.class,
38-
)"
38+
)
3939
"
4040
>
4141
<slot />

src/ui/components/dialog/DialogScrollContent.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
4444
if (originalEvent.offsetX > target.clientWidth || originalEvent.offsetY > target.clientHeight) {
4545
event.preventDefault();
4646
}
47-
}"
47+
}
4848
"
4949
>
5050
<slot />

src/ui/components/dropdown-menu/DropdownMenuCheckboxItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
2929
cn(
3030
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
3131
props.class,
32-
)"
32+
)
3333
"
3434
>
3535
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">

src/ui/components/dropdown-menu/DropdownMenuItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const forwardedProps = useForwardProps(delegatedProps);
2222
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
2323
inset && 'pl-8',
2424
props.class,
25-
)"
25+
)
2626
"
2727
>
2828
<slot />

src/ui/components/dropdown-menu/DropdownMenuRadioItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
3030
cn(
3131
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
3232
props.class,
33-
)"
33+
)
3434
"
3535
>
3636
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">

src/ui/components/dropdown-menu/DropdownMenuSubTrigger.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ const forwardedProps = useForwardProps(delegatedProps);
2222
cn(
2323
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent',
2424
props.class,
25-
)"
25+
)
2626
"
2727
>
2828
<slot />

src/ui/components/menubar/MenubarCheckboxItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
2929
cn(
3030
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
3131
props.class,
32-
)"
32+
)
3333
"
3434
>
3535
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">

src/ui/components/menubar/MenubarItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
2424
'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
2525
inset && 'pl-8',
2626
props.class,
27-
)"
27+
)
2828
"
2929
>
3030
<slot />

src/ui/components/menubar/MenubarRadioItem.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const forwarded = useForwardPropsEmits(delegatedProps, emits);
2929
cn(
3030
'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
3131
props.class,
32-
)"
32+
)
3333
"
3434
>
3535
<span class="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">

src/ui/components/menubar/MenubarSubTrigger.vue

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ const forwardedProps = useForwardProps(delegatedProps);
2323
'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
2424
inset && 'pl-8',
2525
props.class,
26-
)"
26+
)
2727
"
2828
>
2929
<slot />

src/ui/components/scroll-area/ScrollBar.vue

+4-6
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,10 @@ const delegatedProps = computed(() => {
2020
:class="
2121
cn(
2222
'flex touch-none select-none transition-colors',
23-
orientation === 'vertical'
24-
&& 'h-full w-2.5 border-l border-l-transparent p-px',
25-
orientation === 'horizontal'
26-
&& 'h-2.5 flex-col border-t border-t-transparent p-px',
27-
props.class)"
28-
)
23+
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent p-px',
24+
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-px',
25+
props.class,
26+
)
2927
"
3028
>
3129
<ScrollAreaThumb class="relative flex-1 rounded-full bg-border" />

src/ui/components/separator/Separator.vue

+3-5
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ const delegatedProps = computed(() => {
1616
<Separator
1717
v-bind="delegatedProps"
1818
:class="
19-
'shrink-0 bg-border relative',
20-
props.orientation === 'vertical' ? 'w-px h-full' : 'h-px w-full',
21-
props.class,
22-
)
19+
cn('shrink-0 bg-border relative', props.orientation === 'vertical' ? 'w-px h-full' : 'h-px w-full', props.class)
2320
"
2421
>
2522
<span
@@ -30,7 +27,8 @@ const delegatedProps = computed(() => {
3027
props.orientation === 'vertical' ? 'w-[1px] px-1 py-2' : 'h-[1px] py-1 px-2',
3128
)
3229
"
33-
>{{ props.label }}</span
3430
>
31+
{{ props.label }}
32+
</span>
3533
</Separator>
3634
</template>

src/ui/components/toast/use-toast.ts

+1-6
Original file line numberDiff line numberDiff line change
@@ -94,12 +94,7 @@ function dispatch(action: Action) {
9494
}
9595

9696
state.value.toasts = state.value.toasts.map((t) =>
97-
t.id === toastId || toastId === undefined
98-
? {
99-
...t,
100-
open: false,
101-
}
102-
: t,
97+
t.id === toastId || toastId === undefined ? { ...t, open: false } : t,
10398
);
10499
break;
105100
}

0 commit comments

Comments
 (0)