From a6dc7e1ddc1cf59a0d9d9465684b10def4b71d6a Mon Sep 17 00:00:00 2001 From: javayhu Date: Mon, 17 Feb 2025 00:34:01 +0800 Subject: [PATCH] chore: apply Biome formatting and semicolon consistency across project files --- biome.json | 124 +++++++++++++++++++------------------ components.json | 2 +- src/app/dashboard/page.tsx | 10 +-- src/app/login/page.tsx | 6 +- src/hooks/use-mobile.tsx | 24 +++---- src/lib/utils.ts | 6 +- 6 files changed, 88 insertions(+), 84 deletions(-) diff --git a/biome.json b/biome.json index 27e6b9d..5d9fb6e 100644 --- a/biome.json +++ b/biome.json @@ -1,63 +1,65 @@ { - "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", - "vcs": { - "enabled": false, - "clientKind": "git", - "useIgnoreFile": false - }, - "files": { - "ignoreUnknown": true, - "ignore": [ - ".next/**", - "node_modules/**", - "dist/**", - "build/**", - "src/components/*.tsx", - "src/components/ui/*.tsx", - "src/components/magicui/*.tsx" - ] - }, - "formatter": { - "enabled": true, - "indentStyle": "space", - "indentWidth": 2, - "lineWidth": 100, - "formatWithErrors": true - }, - "organizeImports": { - "enabled": true - }, - "linter": { - "enabled": true, - "rules": { - "recommended": true, - "suspicious": { - "noSparseArray": "off" - }, - "style": { - "useTemplate": "off", - "noNonNullAssertion": "off", - "useShorthandArrayType": "off" - }, - "a11y": { - "useValidAnchor": "off" - } - }, - "ignore": [ - ".next/**", - "node_modules/**", - "dist/**", - "build/**", - "src/components/*.tsx", - "src/components/ui/*.tsx", - "src/components/magicui/*.tsx" - ] - }, - "javascript": { - "formatter": { - "quoteStyle": "double", - "trailingCommas": "es5", - "semicolons": "always" - } - } + "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", + "vcs": { + "enabled": false, + "clientKind": "git", + "useIgnoreFile": false + }, + "files": { + "ignoreUnknown": true, + "ignore": [ + ".next/**", + "node_modules/**", + "dist/**", + "build/**", + "src/components/*.tsx", + "src/components/ui/*.tsx", + "src/components/magicui/*.tsx", + "tailwind.config.ts" + ] + }, + "formatter": { + "enabled": true, + "indentStyle": "space", + "indentWidth": 2, + "lineWidth": 80, + "formatWithErrors": true + }, + "organizeImports": { + "enabled": true + }, + "linter": { + "enabled": true, + "rules": { + "recommended": true, + "suspicious": { + "noSparseArray": "off" + }, + "style": { + "useTemplate": "off", + "noNonNullAssertion": "off", + "useShorthandArrayType": "off" + }, + "a11y": { + "useValidAnchor": "off" + } + }, + "ignore": [ + ".next/**", + "node_modules/**", + "dist/**", + "build/**", + "src/components/*.tsx", + "src/components/ui/*.tsx", + "src/components/magicui/*.tsx", + "tailwind.config.ts" + ] + }, + "javascript": { + "formatter": { + "quoteStyle": "double", + "trailingCommas": "es5", + "semicolons": "always" + } + } } diff --git a/components.json b/components.json index 7444556..0df66ae 100644 --- a/components.json +++ b/components.json @@ -18,4 +18,4 @@ "hooks": "@/hooks" }, "iconLibrary": "lucide" -} \ No newline at end of file +} diff --git a/src/app/dashboard/page.tsx b/src/app/dashboard/page.tsx index caa8889..3b3112f 100644 --- a/src/app/dashboard/page.tsx +++ b/src/app/dashboard/page.tsx @@ -1,4 +1,4 @@ -import { AppSidebar } from "@/components/app-sidebar" +import { AppSidebar } from "@/components/app-sidebar"; import { Breadcrumb, BreadcrumbItem, @@ -6,13 +6,13 @@ import { BreadcrumbList, BreadcrumbPage, BreadcrumbSeparator, -} from "@/components/ui/breadcrumb" -import { Separator } from "@/components/ui/separator" +} from "@/components/ui/breadcrumb"; +import { Separator } from "@/components/ui/separator"; import { SidebarInset, SidebarProvider, SidebarTrigger, -} from "@/components/ui/sidebar" +} from "@/components/ui/sidebar"; export default function Page() { return ( @@ -48,5 +48,5 @@ export default function Page() { - ) + ); } diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 42cbaf7..e7b21cd 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,6 +1,6 @@ -import { GalleryVerticalEnd } from "lucide-react" +import { GalleryVerticalEnd } from "lucide-react"; -import { LoginForm } from "@/components/login-form" +import { LoginForm } from "@/components/login-form"; export default function LoginPage() { return ( @@ -15,5 +15,5 @@ export default function LoginPage() { - ) + ); } diff --git a/src/hooks/use-mobile.tsx b/src/hooks/use-mobile.tsx index 2b0fe1d..48fab93 100644 --- a/src/hooks/use-mobile.tsx +++ b/src/hooks/use-mobile.tsx @@ -1,19 +1,21 @@ -import * as React from "react" +import * as React from "react"; -const MOBILE_BREAKPOINT = 768 +const MOBILE_BREAKPOINT = 768; export function useIsMobile() { - const [isMobile, setIsMobile] = React.useState(undefined) + const [isMobile, setIsMobile] = React.useState( + undefined + ); React.useEffect(() => { - const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`) + const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`); const onChange = () => { - setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) - } - mql.addEventListener("change", onChange) - setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) - return () => mql.removeEventListener("change", onChange) - }, []) + setIsMobile(window.innerWidth < MOBILE_BREAKPOINT); + }; + mql.addEventListener("change", onChange); + setIsMobile(window.innerWidth < MOBILE_BREAKPOINT); + return () => mql.removeEventListener("change", onChange); + }, []); - return !!isMobile + return !!isMobile; } diff --git a/src/lib/utils.ts b/src/lib/utils.ts index bd0c391..365058c 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,6 +1,6 @@ -import { clsx, type ClassValue } from "clsx" -import { twMerge } from "tailwind-merge" +import { type ClassValue, clsx } from "clsx"; +import { twMerge } from "tailwind-merge"; export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) + return twMerge(clsx(inputs)); }