From f021eabab64490ebf0f39509642a7d86ad858af8 Mon Sep 17 00:00:00 2001 From: 苏向夜 Date: Thu, 26 Mar 2026 08:07:22 +0800 Subject: chore(lint): partial apply docs code lint --- packages/docs/app/root.tsx | 49 +++++++++++++++++++++++++--------------------- 1 file changed, 27 insertions(+), 22 deletions(-) (limited to 'packages/docs/app/root.tsx') diff --git a/packages/docs/app/root.tsx b/packages/docs/app/root.tsx index 9032c80..621175c 100644 --- a/packages/docs/app/root.tsx +++ b/packages/docs/app/root.tsx @@ -1,3 +1,4 @@ +import { RootProvider } from "fumadocs-ui/provider/react-router"; import { isRouteErrorResponse, Link, @@ -7,40 +8,39 @@ import { Scripts, ScrollRestoration, useParams, -} from 'react-router'; -import { RootProvider } from 'fumadocs-ui/provider/react-router'; -import type { Route } from './+types/root'; -import './app.css'; -import { defineI18nUI } from 'fumadocs-ui/i18n'; -import { i18n } from './lib/i18n'; +} from "react-router"; +import type { Route } from "./+types/root"; +import "./app.css"; +import { defineI18nUI } from "fumadocs-ui/i18n"; +import { i18n } from "./lib/i18n"; const { provider } = defineI18nUI(i18n, { translations: { en: { - displayName: 'English', + displayName: "English", }, zh: { - displayName: '中文', - search: '查找文档', + displayName: "中文", + search: "查找文档", }, }, }); export const links: Route.LinksFunction = () => [ - { rel: 'preconnect', href: 'https://fonts.googleapis.com' }, + { rel: "preconnect", href: "https://fonts.googleapis.com" }, { - rel: 'preconnect', - href: 'https://fonts.gstatic.com', - crossOrigin: 'anonymous', + rel: "preconnect", + href: "https://fonts.gstatic.com", + crossOrigin: "anonymous", }, { - rel: 'stylesheet', - href: 'https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap', + rel: "stylesheet", + href: "https://fonts.googleapis.com/css2?family=Inter:ital,opsz,wght@0,14..32,100..900;1,14..32,100..900&display=swap", }, ]; export function Layout({ children }: { children: React.ReactNode }) { const { lang = i18n.defaultLanguage } = useParams(); - + return ( @@ -63,14 +63,16 @@ export default function App() { } export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { - let message = 'Oops!'; - let details = 'An unexpected error occurred.'; + let message = "Oops!"; + let details = "An unexpected error occurred."; let stack: string | undefined; if (isRouteErrorResponse(error)) { - message = error.status === 404 ? '404' : 'Error'; + message = error.status === 404 ? "404" : "Error"; details = - error.status === 404 ? 'The requested page could not be found.' : error.statusText || details; + error.status === 404 + ? "The requested page could not be found." + : error.statusText || details; } else if (import.meta.env.DEV && error && error instanceof Error) { details = error.message; stack = error.stack; @@ -83,7 +85,8 @@ export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) {

{details}

- Sorry, we couldn't find the page you're looking for. It might have been moved or deleted. + Sorry, we couldn't find the page you're looking for. It might have been + moved or deleted.

{stack && (
-

Error Stack

+

+ Error Stack +

             {stack}
           
-- cgit v1.2.3-70-g09d2