From 36870785bcc80ad7122e5c3bc45742af0663b2bd Mon Sep 17 00:00:00 2001 From: z0x Date: Thu, 24 Apr 2025 22:12:22 -0400 Subject: [PATCH] refactor: biome lint --- components.json | 36 +- package.json | 122 ++--- src/components/BlogCard.astro | 22 +- src/components/Breadcrumbs.astro | 28 +- src/components/Container.astro | 6 +- src/components/Footer.astro | 8 +- src/components/Head.astro | 24 +- src/components/Header.astro | 8 +- src/components/Link.astro | 16 +- src/components/PostNavigation.astro | 10 +- src/components/SocialIcons.astro | 14 +- src/components/TableOfContents.astro | 28 +- src/components/TableOfContentsHeading.astro | 6 +- src/components/ui/avatar.tsx | 106 ++--- src/components/ui/badge.tsx | 76 ++-- src/components/ui/breadcrumb.tsx | 174 +++---- src/components/ui/card.tsx | 150 +++---- src/components/ui/dropdown-menu.tsx | 380 ++++++++-------- src/components/ui/mode-toggle.tsx | 118 ++--- src/components/ui/pagination.tsx | 309 +++++++------ src/components/ui/scroll-area.tsx | 92 ++-- src/components/ui/separator.tsx | 40 +- src/content.config.ts | 30 +- src/layouts/Layout.astro | 16 +- src/lib/server-utils.ts | 44 +- src/lib/utils.ts | 24 +- src/pages/404.astro | 14 +- src/pages/blog/[...page].astro | 50 ++- src/pages/index.astro | 22 +- src/pages/robots.txt.ts | 10 +- src/pages/rss.xml.ts | 44 +- src/styles/callout.css | 473 ++++++++++---------- src/styles/global.css | 132 +++--- src/types.ts | 22 +- tsconfig.json | 20 +- 35 files changed, 1344 insertions(+), 1330 deletions(-) diff --git a/components.json b/components.json index 8ff1f8e..d4ff7dc 100644 --- a/components.json +++ b/components.json @@ -1,20 +1,20 @@ { - "$schema": "https://ui.shadcn.com/schema.json", - "style": "new-york", - "rsc": false, - "tsx": true, - "tailwind": { - "config": "tailwind.config.ts", - "css": "src/styles/global.css", - "baseColor": "neutral", - "cssVariables": true, - "prefix": "" - }, - "aliases": { - "components": "@/components", - "utils": "@/lib/utils", - "ui": "@/components/ui", - "lib": "@/lib", - "hooks": "@/hooks" - } + "$schema": "https://ui.shadcn.com/schema.json", + "style": "new-york", + "rsc": false, + "tsx": true, + "tailwind": { + "config": "tailwind.config.ts", + "css": "src/styles/global.css", + "baseColor": "neutral", + "cssVariables": true, + "prefix": "" + }, + "aliases": { + "components": "@/components", + "utils": "@/lib/utils", + "ui": "@/components/ui", + "lib": "@/lib", + "hooks": "@/hooks" + } } diff --git a/package.json b/package.json index 4a0aaf5..d60d3f4 100644 --- a/package.json +++ b/package.json @@ -1,63 +1,63 @@ { - "name": "astro-erudite", - "type": "module", - "version": "1.4.2", - "private": true, - "scripts": { - "dev": "astro dev", - "start": "astro dev", - "build": "astro build", - "preview": "astro preview", - "astro": "astro", - "prettier": "prettier --write .", - "postinstall": "patch-package" - }, - "dependencies": { - "@astrojs/markdown-remark": "^6.3.1", - "@astrojs/partytown": "^2.1.4", - "@astrojs/react": "^4.2.5", - "@astrojs/rss": "^4.0.11", - "@astrojs/sitemap": "^3.3.1", - "@expressive-code/plugin-collapsible-sections": "^0.40.2", - "@expressive-code/plugin-line-numbers": "^0.40.2", - "@fontsource-variable/geist": "^5.2.5", - "@fontsource-variable/geist-mono": "^5.2.5", - "@iconify-json/lucide": "^1.2.39", - "@iconify-json/simple-icons": "^1.2.33", - "@r4ai/remark-callout": "^0.6.2", - "@radix-ui/react-avatar": "^1.1.7", - "@radix-ui/react-dropdown-menu": "^2.1.12", - "@radix-ui/react-icons": "^1.3.2", - "@radix-ui/react-scroll-area": "^1.2.6", - "@radix-ui/react-separator": "^1.1.4", - "@radix-ui/react-slot": "^1.2.0", - "@tailwindcss/vite": "^4.1.4", - "@types/react": "19.0.0", - "@types/react-dom": "19.0.0", - "@yeskunall/astro-umami": "^0.0.5", - "astro": "^5.7.5", - "astro-expressive-code": "^0.40.2", - "astro-icon": "^1.1.5", - "class-variance-authority": "^0.7.1", - "clsx": "^2.1.1", - "lucide-react": "^0.469.0", - "patch-package": "^8.0.0", - "react": "19.0.0", - "react-dom": "19.0.0", - "rehype-document": "^7.0.3", - "rehype-external-links": "^3.0.0", - "rehype-katex": "^7.0.1", - "rehype-pretty-code": "^0.14.1", - "remark-emoji": "^5.0.1", - "remark-math": "^6.0.0", - "remark-sectionize": "^2.1.0", - "remark-toc": "^9.0.0", - "tailwind-merge": "^3.2.0", - "tailwindcss": "^4.1.4", - "typescript": "^5.8.3" - }, - "devDependencies": { - "@biomejs/biome": "^1.9.4" - }, - "trustedDependencies": ["@biomejs/biome", "esbuild", "sharp"] + "name": "astro-erudite", + "type": "module", + "version": "1.4.2", + "private": true, + "scripts": { + "dev": "astro dev", + "start": "astro dev", + "build": "astro build", + "preview": "astro preview", + "astro": "astro", + "prettier": "prettier --write .", + "postinstall": "patch-package" + }, + "dependencies": { + "@astrojs/markdown-remark": "^6.3.1", + "@astrojs/partytown": "^2.1.4", + "@astrojs/react": "^4.2.5", + "@astrojs/rss": "^4.0.11", + "@astrojs/sitemap": "^3.3.1", + "@expressive-code/plugin-collapsible-sections": "^0.40.2", + "@expressive-code/plugin-line-numbers": "^0.40.2", + "@fontsource-variable/geist": "^5.2.5", + "@fontsource-variable/geist-mono": "^5.2.5", + "@iconify-json/lucide": "^1.2.39", + "@iconify-json/simple-icons": "^1.2.33", + "@r4ai/remark-callout": "^0.6.2", + "@radix-ui/react-avatar": "^1.1.7", + "@radix-ui/react-dropdown-menu": "^2.1.12", + "@radix-ui/react-icons": "^1.3.2", + "@radix-ui/react-scroll-area": "^1.2.6", + "@radix-ui/react-separator": "^1.1.4", + "@radix-ui/react-slot": "^1.2.0", + "@tailwindcss/vite": "^4.1.4", + "@types/react": "19.0.0", + "@types/react-dom": "19.0.0", + "@yeskunall/astro-umami": "^0.0.5", + "astro": "^5.7.5", + "astro-expressive-code": "^0.40.2", + "astro-icon": "^1.1.5", + "class-variance-authority": "^0.7.1", + "clsx": "^2.1.1", + "lucide-react": "^0.469.0", + "patch-package": "^8.0.0", + "react": "19.0.0", + "react-dom": "19.0.0", + "rehype-document": "^7.0.3", + "rehype-external-links": "^3.0.0", + "rehype-katex": "^7.0.1", + "rehype-pretty-code": "^0.14.1", + "remark-emoji": "^5.0.1", + "remark-math": "^6.0.0", + "remark-sectionize": "^2.1.0", + "remark-toc": "^9.0.0", + "tailwind-merge": "^3.2.0", + "tailwindcss": "^4.1.4", + "typescript": "^5.8.3" + }, + "devDependencies": { + "@biomejs/biome": "^1.9.4" + }, + "trustedDependencies": ["@biomejs/biome", "esbuild", "sharp"] } diff --git a/src/components/BlogCard.astro b/src/components/BlogCard.astro index d6bfcbf..5d9240b 100644 --- a/src/components/BlogCard.astro +++ b/src/components/BlogCard.astro @@ -1,20 +1,20 @@ --- -import { Separator } from '@/components/ui/separator' -import { formatDate, readingTime } from '@/lib/utils' -import { Image } from 'astro:assets' -import type { CollectionEntry } from 'astro:content' -import Link from './Link.astro' +import { Image } from "astro:assets"; +import type { CollectionEntry } from "astro:content"; +import { Separator } from "@/components/ui/separator"; +import { formatDate, readingTime } from "@/lib/utils"; +import Link from "./Link.astro"; type Props = { - entry: CollectionEntry<'blog'> -} + entry: CollectionEntry<"blog">; +}; const { entry } = Astro.props as { - entry: CollectionEntry<'blog'> -} + entry: CollectionEntry<"blog">; +}; -const formattedDate = formatDate(entry.data.date) -const readTime = readingTime(entry.body!) +const formattedDate = formatDate(entry.data.date); +const readTime = readingTime(entry.body!); ---
diff --git a/src/components/Container.astro b/src/components/Container.astro index fe3d4e3..c26cf8c 100644 --- a/src/components/Container.astro +++ b/src/components/Container.astro @@ -1,11 +1,11 @@ --- -import { cn } from '@/lib/utils' +import { cn } from "@/lib/utils"; interface Props { - class?: string + class?: string; } -const { class: className } = Astro.props +const { class: className } = Astro.props; ---
diff --git a/src/components/Footer.astro b/src/components/Footer.astro index 3779da4..b782b3b 100644 --- a/src/components/Footer.astro +++ b/src/components/Footer.astro @@ -1,8 +1,8 @@ --- -import Container from '@/components/Container.astro' -import { Separator } from '@/components/ui/separator' -import { SOCIAL_LINKS } from '@/consts' -import SocialIcons from './SocialIcons.astro' +import Container from "@/components/Container.astro"; +import { Separator } from "@/components/ui/separator"; +import { SOCIAL_LINKS } from "@/consts"; +import SocialIcons from "./SocialIcons.astro"; ---