Skip to content

Commit ebaac9b

Browse files
committed
feat: added biome for formatting and linting
1 parent 2973e5b commit ebaac9b

File tree

18 files changed

+1263
-1201
lines changed

18 files changed

+1263
-1201
lines changed

AGENTS.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@
55
- `bun run dev` - Start development server with turbo
66
- `bun run start` - Start production server
77
- `bun run postinstall` - Process MDX files with fumadocs-mdx
8-
- No explicit lint/test commands configured - this is a documentation site
8+
- `bun run lint` - Lint code with Biome
9+
- `bun run lint:fix` - Lint and auto-fix issues with Biome
10+
- `bun run format` - Check code formatting with Biome
11+
- `bun run format:fix` - Format code with Biome
12+
- `bun run check` - Run both linting and formatting checks
13+
- `bun run check:fix` - Run both linting and formatting with auto-fix
14+
- No test commands configured - this is a documentation site
915

1016
## Navigation Management
1117
The site uses a **modular JSON navigation system** instead of fumadocs meta.json files:

biome.json

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"ignoreUnknown": false
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"indentStyle": "tab"
14+
},
15+
"linter": {
16+
"enabled": true,
17+
"rules": {
18+
"recommended": true,
19+
"suspicious": {
20+
"noUnknownAtRules": "off"
21+
}
22+
}
23+
},
24+
"css": {
25+
"linter": {
26+
"enabled": true
27+
}
28+
},
29+
"javascript": {
30+
"formatter": {
31+
"quoteStyle": "double"
32+
}
33+
},
34+
"assist": {
35+
"enabled": true,
36+
"actions": {
37+
"source": {
38+
"organizeImports": "on"
39+
}
40+
}
41+
}
42+
}

bun.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
"tailwind-merge": "^3.3.1",
2020
},
2121
"devDependencies": {
22+
"@biomejs/biome": "^2.2.2",
2223
"@tailwindcss/postcss": "^4.1.11",
2324
"@types/mdx": "^2.0.13",
2425
"@types/node": "24.1.0",
@@ -36,6 +37,24 @@
3637

3738
"@ampproject/remapping": ["@ampproject/remapping@2.3.0", "", { "dependencies": { "@jridgewell/gen-mapping": "^0.3.5", "@jridgewell/trace-mapping": "^0.3.24" } }, "sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw=="],
3839

40+
"@biomejs/biome": ["@biomejs/biome@2.2.2", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "2.2.2", "@biomejs/cli-darwin-x64": "2.2.2", "@biomejs/cli-linux-arm64": "2.2.2", "@biomejs/cli-linux-arm64-musl": "2.2.2", "@biomejs/cli-linux-x64": "2.2.2", "@biomejs/cli-linux-x64-musl": "2.2.2", "@biomejs/cli-win32-arm64": "2.2.2", "@biomejs/cli-win32-x64": "2.2.2" }, "bin": { "biome": "bin/biome" } }, "sha512-j1omAiQWCkhuLgwpMKisNKnsM6W8Xtt1l0WZmqY/dFj8QPNkIoTvk4tSsi40FaAAkBE1PU0AFG2RWFBWenAn+w=="],
41+
42+
"@biomejs/cli-darwin-arm64": ["@biomejs/cli-darwin-arm64@2.2.2", "", { "os": "darwin", "cpu": "arm64" }, "sha512-6ePfbCeCPryWu0CXlzsWNZgVz/kBEvHiPyNpmViSt6A2eoDf4kXs3YnwQPzGjy8oBgQulrHcLnJL0nkCh80mlQ=="],
43+
44+
"@biomejs/cli-darwin-x64": ["@biomejs/cli-darwin-x64@2.2.2", "", { "os": "darwin", "cpu": "x64" }, "sha512-Tn4JmVO+rXsbRslml7FvKaNrlgUeJot++FkvYIhl1OkslVCofAtS35MPlBMhXgKWF9RNr9cwHanrPTUUXcYGag=="],
45+
46+
"@biomejs/cli-linux-arm64": ["@biomejs/cli-linux-arm64@2.2.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-JfrK3gdmWWTh2J5tq/rcWCOsImVyzUnOS2fkjhiYKCQ+v8PqM+du5cfB7G1kXas+7KQeKSWALv18iQqdtIMvzw=="],
47+
48+
"@biomejs/cli-linux-arm64-musl": ["@biomejs/cli-linux-arm64-musl@2.2.2", "", { "os": "linux", "cpu": "arm64" }, "sha512-/MhYg+Bd6renn6i1ylGFL5snYUn/Ct7zoGVKhxnro3bwekiZYE8Kl39BSb0MeuqM+72sThkQv4TnNubU9njQRw=="],
49+
50+
"@biomejs/cli-linux-x64": ["@biomejs/cli-linux-x64@2.2.2", "", { "os": "linux", "cpu": "x64" }, "sha512-Ogb+77edO5LEP/xbNicACOWVLt8mgC+E1wmpUakr+O4nKwLt9vXe74YNuT3T1dUBxC/SnrVmlzZFC7kQJEfquQ=="],
51+
52+
"@biomejs/cli-linux-x64-musl": ["@biomejs/cli-linux-x64-musl@2.2.2", "", { "os": "linux", "cpu": "x64" }, "sha512-ZCLXcZvjZKSiRY/cFANKg+z6Fhsf9MHOzj+NrDQcM+LbqYRT97LyCLWy2AS+W2vP+i89RyRM+kbGpUzbRTYWig=="],
53+
54+
"@biomejs/cli-win32-arm64": ["@biomejs/cli-win32-arm64@2.2.2", "", { "os": "win32", "cpu": "arm64" }, "sha512-wBe2wItayw1zvtXysmHJQoQqXlTzHSpQRyPpJKiNIR21HzH/CrZRDFic1C1jDdp+zAPtqhNExa0owKMbNwW9cQ=="],
55+
56+
"@biomejs/cli-win32-x64": ["@biomejs/cli-win32-x64@2.2.2", "", { "os": "win32", "cpu": "x64" }, "sha512-DAuHhHekGfiGb6lCcsT4UyxQmVwQiBCBUMwVra/dcOSs9q8OhfaZgey51MlekT3p8UwRqtXQfFuEJBhJNdLZwg=="],
57+
3958
"@emnapi/runtime": ["@emnapi/runtime@1.4.5", "", { "dependencies": { "tslib": "^2.4.0" } }, "sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg=="],
4059

4160
"@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.8", "", { "os": "aix", "cpu": "ppc64" }, "sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA=="],

package.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,13 @@
66
"build": "next build",
77
"dev": "next dev --turbo",
88
"start": "next start",
9-
"postinstall": "fumadocs-mdx"
9+
"postinstall": "fumadocs-mdx",
10+
"lint": "biome lint src/",
11+
"lint:fix": "biome lint --write src/",
12+
"format": "biome format src/",
13+
"format:fix": "biome format --write src/",
14+
"check": "biome check src/",
15+
"check:fix": "biome check --write src/"
1016
},
1117
"dependencies": {
1218
"class-variance-authority": "^0.7.1",
@@ -24,6 +30,7 @@
2430
"tailwind-merge": "^3.3.1"
2531
},
2632
"devDependencies": {
33+
"@biomejs/biome": "^2.2.2",
2734
"@tailwindcss/postcss": "^4.1.11",
2835
"@types/mdx": "^2.0.13",
2936
"@types/node": "24.1.0",
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import { DocsLayout } from 'fumadocs-ui/layouts/docs';
2-
import type { ReactNode } from 'react';
3-
import { baseOptions } from '@/app/layout.config';
4-
import { navigationTree } from '@/navigation';
1+
import { DocsLayout } from "fumadocs-ui/layouts/docs";
2+
import type { ReactNode } from "react";
3+
import { baseOptions } from "@/app/layout.config";
4+
import { navigationTree } from "@/navigation";
55

66
export default function Layout({ children }: { children: ReactNode }) {
7-
return (
8-
<DocsLayout tree={navigationTree} {...baseOptions}>
9-
{children}
10-
</DocsLayout>
11-
);
7+
return (
8+
<DocsLayout tree={navigationTree} {...baseOptions}>
9+
{children}
10+
</DocsLayout>
11+
);
1212
}

src/app/(docs)/[...slug]/page.tsx

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
import { source } from '@/lib/source';
1+
import { createRelativeLink } from "fumadocs-ui/mdx";
22
import {
3-
DocsPage,
4-
DocsBody,
5-
DocsDescription,
6-
DocsTitle,
7-
} from 'fumadocs-ui/page';
8-
import { notFound } from 'next/navigation';
9-
import { createRelativeLink } from 'fumadocs-ui/mdx';
10-
import { getMDXComponents } from '@/mdx-components';
3+
DocsBody,
4+
DocsDescription,
5+
DocsPage,
6+
DocsTitle,
7+
} from "fumadocs-ui/page";
8+
import { notFound } from "next/navigation";
9+
import { source } from "@/lib/source";
10+
import { getMDXComponents } from "@/mdx-components";
1111

1212
export default async function Page(props: {
13-
params: Promise<{ slug?: string[] }>;
13+
params: Promise<{ slug?: string[] }>;
1414
}) {
15-
const params = await props.params;
16-
const page = source.getPage(params.slug);
17-
if (!page) notFound();
15+
const params = await props.params;
16+
const page = source.getPage(params.slug);
17+
if (!page) notFound();
1818

19-
const MDXContent = page.data.body;
19+
const MDXContent = page.data.body;
2020

21-
return (
22-
<DocsPage toc={page.data.toc} full={page.data.full}>
23-
<DocsTitle>{page.data.title}</DocsTitle>
24-
<DocsDescription>{page.data.description}</DocsDescription>
25-
<DocsBody>
26-
<MDXContent
27-
components={getMDXComponents({
28-
// this allows you to link to other pages with relative file paths
29-
a: createRelativeLink(source, page),
30-
})}
31-
/>
32-
</DocsBody>
33-
</DocsPage>
34-
);
21+
return (
22+
<DocsPage toc={page.data.toc} full={page.data.full}>
23+
<DocsTitle>{page.data.title}</DocsTitle>
24+
<DocsDescription>{page.data.description}</DocsDescription>
25+
<DocsBody>
26+
<MDXContent
27+
components={getMDXComponents({
28+
// this allows you to link to other pages with relative file paths
29+
a: createRelativeLink(source, page),
30+
})}
31+
/>
32+
</DocsBody>
33+
</DocsPage>
34+
);
3535
}
3636

3737
export async function generateStaticParams() {
38-
return source.generateParams();
38+
return source.generateParams();
3939
}
4040

4141
export async function generateMetadata(props: {
42-
params: Promise<{ slug?: string[] }>;
42+
params: Promise<{ slug?: string[] }>;
4343
}) {
44-
const params = await props.params;
45-
const page = source.getPage(params.slug);
46-
if (!page) notFound();
44+
const params = await props.params;
45+
const page = source.getPage(params.slug);
46+
if (!page) notFound();
4747

48-
return {
49-
title: page.data.title,
50-
description: page.data.description,
51-
};
48+
return {
49+
title: page.data.title,
50+
description: page.data.description,
51+
};
5252
}

src/app/api/search/route.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { source } from '@/lib/source';
2-
import { createFromSource } from 'fumadocs-core/search/server';
1+
import { createFromSource } from "fumadocs-core/search/server";
2+
import { source } from "@/lib/source";
33

44
export const { GET } = createFromSource(source, {
5-
// https://docs.orama.com/open-source/supported-languages
6-
language: 'english',
5+
// https://docs.orama.com/open-source/supported-languages
6+
language: "english",
77
});

src/app/layout.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
import '@/app/global.css';
2-
import { RootProvider } from 'fumadocs-ui/provider';
3-
import { Inter } from 'next/font/google';
4-
import type { ReactNode } from 'react';
1+
import "@/app/global.css";
2+
import { RootProvider } from "fumadocs-ui/provider";
3+
import { Inter } from "next/font/google";
4+
import type { ReactNode } from "react";
55

66
const inter = Inter({
7-
subsets: ['latin'],
7+
subsets: ["latin"],
88
});
99

1010
export default function Layout({ children }: { children: ReactNode }) {
11-
return (
12-
<html lang="en" className={inter.className} suppressHydrationWarning>
13-
<body className="flex flex-col min-h-screen">
14-
<RootProvider>{children}</RootProvider>
15-
</body>
16-
</html>
17-
);
11+
return (
12+
<html lang="en" className={inter.className} suppressHydrationWarning>
13+
<body className="flex flex-col min-h-screen">
14+
<RootProvider>{children}</RootProvider>
15+
</body>
16+
</html>
17+
);
1818
}

src/app/page.tsx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,6 @@
1+
import { Card } from "fumadocs-ui/components/card";
12
import { HomeLayout } from "fumadocs-ui/layouts/home";
23
import { baseOptions } from "./layout.config";
3-
import { Cards, Card } from "fumadocs-ui/components/card";
4-
import {
5-
FileTextIcon,
6-
UsersIcon,
7-
ShieldIcon,
8-
CodeIcon,
9-
MonitorIcon,
10-
PyramidIcon,
11-
StarIcon,
12-
LayersIcon,
13-
WrenchIcon,
14-
ServerIcon,
15-
AnchorIcon,
16-
ShieldCheckIcon,
17-
RefreshCwIcon,
18-
PlugIcon,
19-
} from "lucide-react";
204

215
export default function HomePage() {
226
return (

0 commit comments

Comments
 (0)