chore: apply Biome formatting and semicolon consistency across project files

This commit is contained in:
javayhu 2025-02-17 00:34:01 +08:00
parent 16309d571a
commit a6dc7e1ddc
6 changed files with 88 additions and 84 deletions

View File

@ -1,63 +1,65 @@
{ {
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json", "$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
"vcs": { "vcs": {
"enabled": false, "enabled": false,
"clientKind": "git", "clientKind": "git",
"useIgnoreFile": false "useIgnoreFile": false
}, },
"files": { "files": {
"ignoreUnknown": true, "ignoreUnknown": true,
"ignore": [ "ignore": [
".next/**", ".next/**",
"node_modules/**", "node_modules/**",
"dist/**", "dist/**",
"build/**", "build/**",
"src/components/*.tsx", "src/components/*.tsx",
"src/components/ui/*.tsx", "src/components/ui/*.tsx",
"src/components/magicui/*.tsx" "src/components/magicui/*.tsx",
] "tailwind.config.ts"
}, ]
"formatter": { },
"enabled": true, "formatter": {
"indentStyle": "space", "enabled": true,
"indentWidth": 2, "indentStyle": "space",
"lineWidth": 100, "indentWidth": 2,
"formatWithErrors": true "lineWidth": 80,
}, "formatWithErrors": true
"organizeImports": { },
"enabled": true "organizeImports": {
}, "enabled": true
"linter": { },
"enabled": true, "linter": {
"rules": { "enabled": true,
"recommended": true, "rules": {
"suspicious": { "recommended": true,
"noSparseArray": "off" "suspicious": {
}, "noSparseArray": "off"
"style": { },
"useTemplate": "off", "style": {
"noNonNullAssertion": "off", "useTemplate": "off",
"useShorthandArrayType": "off" "noNonNullAssertion": "off",
}, "useShorthandArrayType": "off"
"a11y": { },
"useValidAnchor": "off" "a11y": {
} "useValidAnchor": "off"
}, }
"ignore": [ },
".next/**", "ignore": [
"node_modules/**", ".next/**",
"dist/**", "node_modules/**",
"build/**", "dist/**",
"src/components/*.tsx", "build/**",
"src/components/ui/*.tsx", "src/components/*.tsx",
"src/components/magicui/*.tsx" "src/components/ui/*.tsx",
] "src/components/magicui/*.tsx",
}, "tailwind.config.ts"
"javascript": { ]
"formatter": { },
"quoteStyle": "double", "javascript": {
"trailingCommas": "es5", "formatter": {
"semicolons": "always" "quoteStyle": "double",
} "trailingCommas": "es5",
} "semicolons": "always"
}
}
} }

View File

@ -1,4 +1,4 @@
import { AppSidebar } from "@/components/app-sidebar" import { AppSidebar } from "@/components/app-sidebar";
import { import {
Breadcrumb, Breadcrumb,
BreadcrumbItem, BreadcrumbItem,
@ -6,13 +6,13 @@ import {
BreadcrumbList, BreadcrumbList,
BreadcrumbPage, BreadcrumbPage,
BreadcrumbSeparator, BreadcrumbSeparator,
} from "@/components/ui/breadcrumb" } from "@/components/ui/breadcrumb";
import { Separator } from "@/components/ui/separator" import { Separator } from "@/components/ui/separator";
import { import {
SidebarInset, SidebarInset,
SidebarProvider, SidebarProvider,
SidebarTrigger, SidebarTrigger,
} from "@/components/ui/sidebar" } from "@/components/ui/sidebar";
export default function Page() { export default function Page() {
return ( return (
@ -48,5 +48,5 @@ export default function Page() {
</div> </div>
</SidebarInset> </SidebarInset>
</SidebarProvider> </SidebarProvider>
) );
} }

View File

@ -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() { export default function LoginPage() {
return ( return (
@ -15,5 +15,5 @@ export default function LoginPage() {
<LoginForm /> <LoginForm />
</div> </div>
</div> </div>
) );
} }

View File

@ -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() { export function useIsMobile() {
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined) const [isMobile, setIsMobile] = React.useState<boolean | undefined>(
undefined
);
React.useEffect(() => { React.useEffect(() => {
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`) const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
const onChange = () => { const onChange = () => {
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
} };
mql.addEventListener("change", onChange) mql.addEventListener("change", onChange);
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT) setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
return () => mql.removeEventListener("change", onChange) return () => mql.removeEventListener("change", onChange);
}, []) }, []);
return !!isMobile return !!isMobile;
} }

View File

@ -1,6 +1,6 @@
import { clsx, type ClassValue } from "clsx" import { type ClassValue, clsx } from "clsx";
import { twMerge } from "tailwind-merge" import { twMerge } from "tailwind-merge";
export function cn(...inputs: ClassValue[]) { export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs)) return twMerge(clsx(inputs));
} }