chore: lint, update readme

This commit is contained in:
enscribe 2025-02-18 15:25:52 -08:00
parent 0940b7076a
commit cf570be96e
23 changed files with 102 additions and 110 deletions

View file

@ -33,7 +33,7 @@ const socialLinks: SocialLink[] = [
---
<div
class="overflow-hidden rounded-xl border p-4 transition-colors duration-300 ease-in-out has-[a:hover]:bg-secondary/50"
class="has-[a:hover]:bg-secondary/50 overflow-hidden rounded-xl border p-4 transition-colors duration-300 ease-in-out"
>
<div class="flex flex-wrap gap-4">
<Link
@ -48,7 +48,7 @@ const socialLinks: SocialLink[] = [
className={cn(
'size-32 rounded-md',
!linkDisabled &&
'transition-shadow duration-300 hover:cursor-pointer hover:ring-2 hover:ring-primary',
'hover:ring-primary transition-shadow duration-300 hover:cursor-pointer hover:ring-2',
)}
/>
</Link>
@ -58,11 +58,11 @@ const socialLinks: SocialLink[] = [
<h3 class="text-lg font-semibold">{name}</h3>
{
pronouns && (
<span class="text-sm text-muted-foreground">({pronouns})</span>
<span class="text-muted-foreground text-sm">({pronouns})</span>
)
}
</div>
<p class="text-sm text-muted-foreground">{bio}</p>
<p class="text-muted-foreground text-sm">{bio}</p>
</div>
<SocialIcons links={socialLinks} />
</div>

View file

@ -22,7 +22,7 @@ const authors = await parseAuthors(entry.data.authors ?? [])
---
<div
class="not-prose rounded-xl border p-4 transition-colors duration-300 ease-in-out hover:bg-secondary/50"
class="not-prose hover:bg-secondary/50 rounded-xl border p-4 transition-colors duration-300 ease-in-out"
>
<Link
href={`/${entry.collection}/${entry.id}`}
@ -45,11 +45,11 @@ const authors = await parseAuthors(entry.data.authors ?? [])
<h3 class="mb-1 text-lg font-semibold">
{entry.data.title}
</h3>
<p class="mb-2 text-sm text-muted-foreground">
<p class="text-muted-foreground mb-2 text-sm">
{entry.data.description}
</p>
<div
class="mb-2 flex flex-wrap items-center gap-x-2 text-xs text-muted-foreground"
class="text-muted-foreground mb-2 flex flex-wrap items-center gap-x-2 text-xs"
>
{
authors.length > 0 && (

View file

@ -8,4 +8,6 @@ interface Props {
const { class: className } = Astro.props
---
<div class={cn('mx-auto max-w-(--breakpoint-md) px-4', className)}><slot /></div>
<div class={cn('mx-auto max-w-(--breakpoint-md) px-4', className)}>
<slot />
</div>

View file

@ -12,11 +12,11 @@ import SocialIcons from './SocialIcons.astro'
class="flex flex-col items-center justify-center gap-y-2 sm:flex-row sm:justify-between"
>
<div class="flex items-center gap-x-2">
<span class="text-center text-sm text-muted-foreground">
<span class="text-muted-foreground text-center text-sm">
&copy; {new Date().getFullYear()} All rights reserved.
</span>
<Separator orientation="vertical" className="h-4" />
<p class="text-center text-sm text-muted-foreground">
<p class="text-muted-foreground text-center text-sm">
Made with 🤍 by <Link
href="https://github.com/jktrn"
class="text-foreground"

View file

@ -9,14 +9,14 @@ import logo from '../../public/static/logo.svg'
---
<header
class="sticky top-0 z-10 bg-background/50 backdrop-blur-md"
class="bg-background/50 sticky top-0 z-10 backdrop-blur-md"
transition:persist
>
<Container>
<div class="flex flex-wrap items-center justify-between gap-4 py-4">
<Link
href="/"
class="flex shrink-0 items-center gap-2 text-xl font-semibold transition-colors duration-300 hover:text-primary"
class="hover:text-primary flex shrink-0 items-center gap-2 text-xl font-semibold transition-colors duration-300"
>
<Image src={logo} alt="Logo" class="size-8" />
{SITE.TITLE}
@ -27,7 +27,7 @@ import logo from '../../public/static/logo.svg'
NAV_LINKS.map((item) => (
<Link
href={item.href}
class="capitalize text-foreground/60 transition-colors hover:text-foreground/80"
class="text-foreground/60 hover:text-foreground/80 capitalize transition-colors"
>
{item.label}
</Link>

View file

@ -24,7 +24,7 @@ const { prevPost, nextPost } = Astro.props
/>
</div>
<div class="flex flex-col items-start overflow-hidden">
<span class="text-left text-xs text-muted-foreground">Next Post</span>
<span class="text-muted-foreground text-left text-xs">Next Post</span>
<span class="w-full truncate text-left text-sm"
>{nextPost?.data.title || 'Latest post!'}</span
>
@ -40,7 +40,7 @@ const { prevPost, nextPost } = Astro.props
aria-disabled={!prevPost}
>
<div class="flex flex-col items-end overflow-hidden">
<span class="text-right text-xs text-muted-foreground">Previous Post</span
<span class="text-muted-foreground text-right text-xs">Previous Post</span
>
<span class="w-full truncate text-right text-sm"
>{prevPost?.data.title || 'Last post!'}</span

View file

@ -12,7 +12,7 @@ const { project } = Astro.props
---
<div
class="not-prose rounded-xl border p-4 transition-colors duration-300 ease-in-out hover:bg-secondary/50"
class="not-prose hover:bg-secondary/50 rounded-xl border p-4 transition-colors duration-300 ease-in-out"
>
<Link
href={project.data.link}
@ -36,7 +36,7 @@ const { project } = Astro.props
<h3 class="mb-1 text-lg font-semibold">
{project.data.name}
</h3>
<p class="mb-2 text-sm text-muted-foreground">
<p class="text-muted-foreground mb-2 text-sm">
{project.data.description}
</p>
{

View file

@ -6,17 +6,17 @@ const { heading } = Astro.props
---
<li
class="list-inside list-disc px-4 text-sm text-foreground/60 xl:list-none xl:p-0"
class="text-foreground/60 list-inside list-disc px-4 text-sm xl:list-none xl:p-0"
>
<Link
href={'#' + heading.slug}
class="underline decoration-transparent underline-offset-[3px] transition-colors duration-200 hover:decoration-inherit py-1 xl:py-0"
class="py-1 underline decoration-transparent underline-offset-[3px] transition-colors duration-200 hover:decoration-inherit xl:py-0"
>
{heading.text}
</Link>
{
heading.subheadings.length > 0 && (
<ul class="translate-x-3 xl:ml-4 xl:mt-2 xl:flex xl:translate-x-0 xl:flex-col xl:gap-2">
<ul class="translate-x-3 xl:mt-2 xl:ml-4 xl:flex xl:translate-x-0 xl:flex-col xl:gap-2">
{heading.subheadings.map((subheading: Heading) => (
<Astro.self heading={subheading} />
))}

View file

@ -36,7 +36,7 @@ const AvatarFallback = React.forwardRef<
<AvatarPrimitive.Fallback
ref={ref}
className={cn(
'flex size-full items-center justify-center bg-muted',
'bg-muted flex size-full items-center justify-center',
className,
)}
{...props}

View file

@ -18,7 +18,7 @@ const BreadcrumbList = React.forwardRef<
<ol
ref={ref}
className={cn(
'flex flex-wrap items-center gap-1.5 break-words text-sm text-muted-foreground sm:gap-2.5',
'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
className,
)}
{...props}
@ -49,7 +49,7 @@ const BreadcrumbLink = React.forwardRef<
return (
<Comp
ref={ref}
className={cn('transition-colors hover:text-foreground', className)}
className={cn('hover:text-foreground transition-colors', className)}
{...props}
/>
)
@ -65,7 +65,7 @@ const BreadcrumbPage = React.forwardRef<
role="link"
aria-disabled="true"
aria-current="page"
className={cn('font-normal text-foreground', className)}
className={cn('text-foreground font-normal', className)}
{...props}
/>
))

View file

@ -7,7 +7,7 @@ const Card = React.forwardRef<
>(({ className, ...props }, ref) => (
<div
ref={ref}
className={cn('rounded-xl border bg-background', className)}
className={cn('bg-background rounded-xl border', className)}
{...props}
/>
))
@ -31,7 +31,7 @@ const CardTitle = React.forwardRef<
>(({ className, ...props }, ref) => (
<h3
ref={ref}
className={cn('font-semibold leading-none tracking-tight', className)}
className={cn('leading-none font-semibold tracking-tight', className)}
{...props}
/>
))
@ -43,7 +43,7 @@ const CardDescription = React.forwardRef<
>(({ className, ...props }, ref) => (
<p
ref={ref}
className={cn('text-sm text-muted-foreground', className)}
className={cn('text-muted-foreground text-sm', className)}
{...props}
/>
))

View file

@ -28,7 +28,7 @@ const DropdownMenuSubTrigger = React.forwardRef<
<DropdownMenuPrimitive.SubTrigger
ref={ref}
className={cn(
'flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden focus:bg-accent data-[state=open]:bg-accent',
'focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center rounded-xs px-2 py-1.5 text-sm outline-hidden select-none',
inset && 'pl-8',
className,
)}
@ -48,7 +48,7 @@ const DropdownMenuSubContent = React.forwardRef<
<DropdownMenuPrimitive.SubContent
ref={ref}
className={cn(
'bg-popover text-popover-foreground z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
'bg-popover text-popover-foreground 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-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] overflow-hidden rounded-md border p-1 shadow-lg',
className,
)}
{...props}
@ -85,7 +85,7 @@ const DropdownMenuItem = React.forwardRef<
<DropdownMenuPrimitive.Item
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs px-2 py-1.5 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
inset && 'pl-8',
className,
)}
@ -101,7 +101,7 @@ const DropdownMenuCheckboxItem = React.forwardRef<
<DropdownMenuPrimitive.CheckboxItem
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
className,
)}
checked={checked}
@ -125,7 +125,7 @@ const DropdownMenuRadioItem = React.forwardRef<
<DropdownMenuPrimitive.RadioItem
ref={ref}
className={cn(
'relative flex cursor-default select-none items-center rounded-xs py-1.5 pl-8 pr-2 text-sm outline-hidden transition-colors focus:bg-accent focus:text-accent-foreground data-disabled:pointer-events-none data-disabled:opacity-50',
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-xs py-1.5 pr-2 pl-8 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
className,
)}
{...props}
@ -164,7 +164,7 @@ const DropdownMenuSeparator = React.forwardRef<
>(({ className, ...props }, ref) => (
<DropdownMenuPrimitive.Separator
ref={ref}
className={cn('-mx-1 my-1 h-px bg-muted', className)}
className={cn('bg-muted -mx-1 my-1 h-px', className)}
{...props}
/>
))

View file

@ -46,8 +46,8 @@ export function ModeToggle() {
className="group"
title="Toggle theme"
>
<Sun className="size-4 rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0" />
<Moon className="absolute size-4 rotate-90 scale-0 transition-all dark:rotate-0 dark:scale-100" />
<Sun className="size-4 scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" />
<Moon className="absolute size-4 scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" />
<span className="sr-only">Toggle theme</span>
</Button>
</DropdownMenuTrigger>

View file

@ -29,7 +29,7 @@ const ScrollBar = React.forwardRef<
ref={ref}
orientation={orientation}
className={cn(
'flex touch-none select-none transition-colors',
'flex touch-none transition-colors select-none',
orientation === 'vertical' &&
'h-full w-2.5 border-l border-l-transparent p-[1px]',
orientation === 'horizontal' &&
@ -38,7 +38,7 @@ const ScrollBar = React.forwardRef<
)}
{...props}
>
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
<ScrollAreaPrimitive.ScrollAreaThumb className="bg-border relative flex-1 rounded-full" />
</ScrollAreaPrimitive.ScrollAreaScrollbar>
))
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName

View file

@ -15,7 +15,7 @@ const Separator = React.forwardRef<
decorative={decorative}
orientation={orientation}
className={cn(
'shrink-0 bg-border',
'bg-border shrink-0',
orientation === 'horizontal' ? 'h-[1px] w-full' : 'h-full w-[1px]',
className,
)}