Skip to content

Commit 0dbc42c

Browse files
committed
chore: format tw by biome
1 parent 281e7f4 commit 0dbc42c

File tree

21 files changed

+104
-87
lines changed

21 files changed

+104
-87
lines changed

app/about/page.tsx

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,14 @@ export const metadata: Metadata = {
88
};
99

1010
const headingIntroduce = [
11-
'你好,我是 Jsonq(焦松奇),一名<span class="line-through">(API 调用)</span>前端开发人员,主要使用 React、Vue、TypeScript、antd 相关技术进行日常开发和工作。',
12-
'三年工作经验,工作中常用技术栈为 React + antd + <a class="text-link" target="_blank" rel="noopener noreferrer" href="https://learn.microsoft.com/en-us/sharepoint/dev/schema/query-schema">SharePoint CamlQuery</a> + pnpjs(SharePoint Orm)',
11+
'你好,我是 Jsonq(焦松奇),一名<span class="line-through">(API 调用)</span>前端开发人员,主要使用 React、Vue、TypeScript 相关技术进行日常开发和工作。',
12+
'三年工作经验,工作常用技术栈为 Reactantd<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://learn.microsoft.com/en-us/sharepoint/dev/schema/query-schema">SharePoint CamlQuery</a>pnpjs(SharePoint ORM)',
1313
];
1414

1515
const workIntroduceContent = [
16-
"需求分析、功能设计、技术选型、业务数据表结构设计(团队内部讨论)",
16+
"需求分析、功能设计、业务表结构设计",
1717
"基于 SharePoint 进行需求功能开发",
18-
"负责前端项目技术选型及搭建,基础建设功能开发和维护(本人负责)",
18+
"负责前端项目技术选型及搭建,基础建设功能开发和维护",
1919
"参与后端 Java 技术栈开发的部分工作",
2020
];
2121

@@ -27,10 +27,8 @@ export default function AboutPage() {
2727
<p className="py-2 first:pt-0" key={index.toString()} dangerouslySetInnerHTML={{ __html: item }} />
2828
))}
2929

30-
<h2 className="my-4 text-3xl font-semibold tracking-tight">Functions</h2>
31-
<p className="text-foreground/60 mb-2 text-sm">
32-
主要基于 SharePoint 内网平台的定制化功能开发,工作内容较杂,不局限于前端
33-
</p>
30+
<h2 className="my-4 font-semibold text-3xl tracking-tight">Functions</h2>
31+
<p className="mb-2 text-foreground/60 text-sm">主要基于 SharePoint 进行内网办公平台的定制化开发</p>
3432
<ul className="list-disc">
3533
{workIntroduceContent.map((content, index) => (
3634
<li key={index.toString()} className="py-1">
@@ -39,7 +37,7 @@ export default function AboutPage() {
3937
))}
4038
</ul>
4139

42-
<h2 className="my-4 text-3xl font-semibold tracking-tight">Tech Stack</h2>
40+
<h2 className="my-4 font-semibold text-3xl tracking-tight">Tech Stack</h2>
4341
<ul className="flex flex-wrap gap-6 py-4">
4442
{commonTechStack.map((tech, index) => (
4543
<li key={index.toString()}>
@@ -50,7 +48,7 @@ export default function AboutPage() {
5048
))}
5149
</ul>
5250

53-
<h2 className="my-4 text-3xl font-semibold tracking-tight">Learning</h2>
51+
<h2 className="my-4 font-semibold text-3xl tracking-tight">Learning</h2>
5452
<ul className="flex flex-wrap gap-6 py-4">
5553
{otherTechStack.map((tech, index) => (
5654
<li key={index.toString()}>
@@ -59,12 +57,13 @@ export default function AboutPage() {
5957
</Link>
6058
</li>
6159
))}
60+
<li className="inline-flex items-end text-muted-foreground text-sm">and more...</li>
6261
</ul>
6362

64-
<h2 className="my-4 text-3xl font-semibold tracking-tight">Contact</h2>
63+
<h2 className="my-4 font-semibold text-3xl tracking-tight">Contact</h2>
6564
<p className="flex items-center">
6665
<Mail />
67-
<a className="text-link ml-2" href="mailto:j996730508@163.com" rel="noopener noreferrer">
66+
<a className="ml-2 text-link" href="mailto:j996730508@163.com" rel="noopener noreferrer">
6867
j996730508@163.com
6968
</a>
7069
</p>

app/about/techStack.tsx renamed to app/about/techStack.ts

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
TechCentos,
23
TechDocker,
34
TechJava,
45
TechJavaScript,
@@ -19,16 +20,16 @@ export const commonTechStack = [
1920
color: "#F7DF1E",
2021
href: "https://developer.mozilla.org/zh-CN/docs/Web/JavaScript",
2122
},
22-
{
23-
icon: TechReact,
24-
color: "#61dafb",
25-
href: "https://react.dev",
26-
},
2723
{
2824
icon: TechTypeScript,
2925
color: "#3178C6",
3026
href: "https://www.typescriptlang.org",
3127
},
28+
{
29+
icon: TechReact,
30+
color: "#61dafb",
31+
href: "https://react.dev",
32+
},
3233
{
3334
icon: TechPnpjs,
3435
href: "https://pnp.github.io/pnpjs",
@@ -71,11 +72,11 @@ export const otherTechStack = [
7172
color: "#E0234E",
7273
href: "https://nestjs.com",
7374
},
74-
// {
75-
// icon: TechCentos,
76-
// color: '#262577',
77-
// href: 'https://www.centos.org',
78-
// },
75+
{
76+
icon: TechCentos,
77+
color: "#262577",
78+
href: "https://www.centos.org",
79+
},
7980
// {
8081
// icon: TechNginx,
8182
// color: '#009639',

app/error.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ export default function ErrorPage({ error, reset }: { error: Error; reset: () =>
99
}, [error]);
1010

1111
return (
12-
<div className="flex flex-col items-center justify-center space-y-8 pt-24 text-lg text-black dark:text-white">
12+
<div className="flex flex-col items-center justify-center space-y-8 pt-24 text-black text-lg dark:text-white">
1313
<h1 className="text-xl">Oh no, something went wrong... maybe refresh?</h1>
1414
<Button onClick={reset}>Try again</Button>
1515
</div>

app/page.tsx

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,25 @@
11
import type { Metadata } from "next";
2+
import { getPostList } from "~/utils/postData";
23

34
const desc = [
5+
{
6+
heading: "Platform",
7+
content: [
8+
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://github.com/json-q">Github</a>',
9+
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://gitee.com/jsonqi">Gitee</a>',
10+
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://www.cnblogs.com/jsonq">博客园</a>(有意义的内容会同步)',
11+
],
12+
},
413
{
514
heading: "Feature",
615
content: [
716
"Nextjs + shadcn",
8-
"markdown 编写,使用 rehype remark 等相关插件渲染优化展示",
9-
"简单实现 markdown 内容更改后的页面 hmr",
10-
"Github Action 的 CI/CD 部署",
17+
"markdown 编写,rehype remark 等相关插件优化展示",
18+
"简单实现 markdown 编写保存时的页面 hmr",
19+
"Github Action 自动化部署",
1120
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://jsonq.netlify.app">镜像站点</a> 托管 netlify',
1221
"pagefind 本地检索(pagefind 仅支持静态页面,因此 RSC 无法使用)",
1322
"优秀的性能和可访问性,Lighthouse 评分 95+(文章内容大小会影响 Perfermance)",
14-
'更多历史功能(目前移除)可移步 <a class="text-link" target="_blank" rel="noopener noreferrer" href="https://github.com/json-q/jsonq">Github</a>',
15-
],
16-
},
17-
{
18-
heading: "Platform",
19-
content: [
20-
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://github.com/json-q">Github</a>',
21-
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://gitee.com/jsonqi">Gitee</a>',
22-
'<a class="text-link" target="_blank" rel="noopener noreferrer" href="https://www.cnblogs.com/jsonq">博客园</a>(有意义的内容会同步)',
2323
],
2424
},
2525
];
@@ -29,16 +29,28 @@ export const metadata: Metadata = {
2929
description: "基于 Nextjs 的博客, 简约, 专注于内容",
3030
};
3131

32-
export default function Home() {
32+
export default async function Home() {
33+
const postList = await getPostList();
34+
35+
const mergedDesc = [
36+
{
37+
heading: "Recently Updated",
38+
content: postList
39+
.slice(0, 5)
40+
.map((item) => `<a class="underline hover:text-link transition-colors" href=${item.url}>${item.title}</a>`),
41+
},
42+
...desc,
43+
];
44+
3345
return (
3446
<div className="py-8">
35-
<h1 className="mb-4 text-center text-4xl font-extrabold tracking-tight will-change-auto lg:text-5xl">
47+
<h1 className="mb-4 text-center font-extrabold text-4xl tracking-tight will-change-auto lg:text-5xl">
3648
Jsonq&apos;s Blog
3749
</h1>
38-
{desc.map((item) => (
50+
{mergedDesc.map((item) => (
3951
<div key={item.heading} className="px-4 md:px-12">
40-
<h2 className="my-4 text-3xl font-semibold tracking-tight">{item.heading}</h2>
41-
<ul className="list-disc">
52+
<h2 className="my-4 font-semibold text-3xl tracking-tight">{item.heading}</h2>
53+
<ul className="list-disc [&>li]:ml-4">
4254
{item.content.map((content) => (
4355
<li className="py-1" key={content} dangerouslySetInnerHTML={{ __html: content }} />
4456
))}

app/post/page.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ export default async function PostList() {
1616
{postList.map((post) => (
1717
<li
1818
key={post.url}
19-
className="dark:hover:bg-accent mb-2 flex w-full flex-col rounded border p-0 hover:bg-slate-50 dark:border-slate-600"
19+
className="mb-2 flex w-full flex-col rounded border p-0 hover:bg-slate-50 dark:border-slate-600 dark:hover:bg-accent"
2020
>
21-
<Link href={post.url} className="p-4 !text-inherit no-underline hover:text-inherit dark:hover:text-inherit">
21+
<Link href={post.url} className="!text-inherit p-4 no-underline hover:text-inherit dark:hover:text-inherit">
2222
<h5 className="font-bold">{post.title}</h5>
23-
<div className="mt-2 flex justify-between text-sm text-slate-600 dark:text-slate-400">
23+
<div className="mt-2 flex justify-between text-slate-600 text-sm dark:text-slate-400">
2424
<time>{dayjs(post.publishedAt).format("YYYY-MM-DD")}</time>
2525
<time>{post.readingTime}</time>
2626
</div>

biome.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,12 @@
4646
},
4747
"a11y": {
4848
"noSvgWithoutTitle": "off"
49+
},
50+
"nursery": {
51+
"useSortedClasses": {
52+
"level": "warn",
53+
"fix": "safe"
54+
}
4955
}
5056
}
5157
},

components/layouts/error-result.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ export default function ErrorResult(props: ErrorResultProps) {
2727
<div className="flex h-full flex-col items-center justify-center px-4 py-12 sm:px-6 lg:px-8">
2828
<div className="mx-auto max-w-md text-center">
2929
<div className="p-4">
30-
<div className="text-6xl font-bold">{props.status}</div>
30+
<div className="font-bold text-6xl">{props.status}</div>
3131
</div>
3232

33-
<h1 className="text-foreground mt-4 text-3xl font-bold tracking-tight sm:text-4xl">
33+
<h1 className="mt-4 font-bold text-3xl text-foreground tracking-tight sm:text-4xl">
3434
{TipEnum[props.status].title}
3535
</h1>
3636

37-
<p className="text-muted-foreground mt-4 mb-6 text-sm">{TipEnum[props.status].tip}</p>
37+
<p className="mt-4 mb-6 text-muted-foreground text-sm">{TipEnum[props.status].tip}</p>
3838

3939
{props.back === "prev" ? (
4040
<Button variant="secondary" onClick={router.back}>

components/layouts/page-footer/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export default function PageFooter() {
1212
href="https://beian.miit.gov.cn"
1313
target="_blank"
1414
rel="noopener"
15-
className="hover:text-link transition-colors"
15+
className="transition-colors hover:text-link"
1616
>
1717
豫ICP备2022024874号-2
1818
</Link>
@@ -25,7 +25,7 @@ export default function PageFooter() {
2525
href={item.href}
2626
target="_blank"
2727
rel="noopener"
28-
className="hover:text-link transition-colors"
28+
className="transition-colors hover:text-link"
2929
>
3030
<span className="inline-flex items-center gap-x-2">
3131
<item.icon className="size-5" /> {item.title}

components/layouts/page-header/doc-search.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ export default function DocSearch() {
123123
{isMobile === false && (
124124
<Button
125125
variant="outline"
126-
className="bg-muted/50 text-muted-foreground relative h-8 w-full cursor-pointer justify-start rounded-[0.5rem] text-sm font-normal shadow-none sm:pr-12 md:w-32 lg:w-48 xl:w-56"
126+
className="relative h-8 w-full cursor-pointer justify-start rounded-[0.5rem] bg-muted/50 font-normal text-muted-foreground text-sm shadow-none sm:pr-12 md:w-32 lg:w-48 xl:w-56"
127127
>
128128
<Search className="h-16 w-16 shrink-0 opacity-50" />
129129
<span className="inline-flex">Search...</span>
130-
<kbd className="bg-muted pointer-events-none absolute top-[0.3rem] right-[0.3rem] hidden h-5 items-center gap-1 rounded border px-1.5 font-mono text-[10px] font-medium opacity-100 select-none sm:flex">
130+
<kbd className="pointer-events-none absolute top-[0.3rem] right-[0.3rem] hidden h-5 select-none items-center gap-1 rounded border bg-muted px-1.5 font-medium font-mono text-[10px] opacity-100 sm:flex">
131131
<span className="text-xs"></span>K
132132
</kbd>
133133
</Button>
@@ -156,7 +156,7 @@ export default function DocSearch() {
156156
) : results.length === 0 ? (
157157
<EmptyStatus tip="暂无结果" icon={<Search className="h-16 w-16 shrink-0 opacity-50" />} />
158158
) : (
159-
<ScrollArea className="text-foreground min-h-[300px] overflow-x-hidden overflow-y-auto px-2 py-1 md:max-h-[calc(100vh-300px)]">
159+
<ScrollArea className="min-h-[300px] overflow-y-auto overflow-x-hidden px-2 py-1 text-foreground md:max-h-[calc(100vh-300px)]">
160160
<ul className="w-full">
161161
{results.map((item) => (
162162
<ResultList key={item.url} data={item} closeModal={closeModal} />
@@ -176,15 +176,15 @@ function ResultList({ data, closeModal }: { data: PagefindResult; closeModal: ()
176176
onClick={closeModal}
177177
onKeyUp={closeModal}
178178
key={item.url}
179-
className="cursor-pointer gap-2 border-b text-sm text-inherit select-none"
179+
className="cursor-pointer select-none gap-2 border-b text-inherit text-sm"
180180
>
181181
<Link
182182
onKeyDown={(e) => e.key === "Enter" && closeModal()}
183183
href={item.url}
184-
className="hover:bg-accent hover:text-accent-foreground inline-flex w-full flex-col rounded-sm px-3 py-2"
184+
className="inline-flex w-full flex-col rounded-sm px-3 py-2 hover:bg-accent hover:text-accent-foreground"
185185
>
186186
<div className="line-clamp-2 w-full" dangerouslySetInnerHTML={{ __html: item.excerpt }} />
187-
<div className="mt-1 overflow-hidden text-xs font-bold">{item.title}</div>
187+
<div className="mt-1 overflow-hidden font-bold text-xs">{item.title}</div>
188188
</Link>
189189
</li>
190190
);

components/layouts/page-header/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import ThemeSwitcher from "./theme-switcher";
88

99
export default function PageHeader() {
1010
return (
11-
<header className="border-grid bg-background/95 supports-[backdrop-filter]:bg-background/60 sticky top-0 z-50 w-full border-b backdrop-blur">
11+
<header className="sticky top-0 z-50 w-full border-grid border-b bg-background/95 backdrop-blur supports-[backdrop-filter]:bg-background/60">
1212
<div className="m-auto max-w-7xl px-4 sm:px-6 lg:px-8">
1313
<div className="flex h-14 items-center">
1414
<PCNav />

0 commit comments

Comments
 (0)