Skip to content
This repository was archived by the owner on Mar 26, 2026. It is now read-only.

Commit 7dac1a2

Browse files
biome is better i have just decided
1 parent 5cdbd52 commit 7dac1a2

File tree

39 files changed

+855
-1139
lines changed

39 files changed

+855
-1139
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
1-
name: tsc
1+
name: biome
22
on:
33
- push
44
- pull_request
55

66
jobs:
77
lint:
8-
name: Lint
8+
name: Lint & Format
99
runs-on: ubuntu-latest
1010
steps:
1111
- uses: actions/checkout@v4
1212
- uses: actions/setup-node@v4
13-
- run: npm install -g yarn # this is necessary for act, also just a good failsafe
13+
- run: npm install -g yarn
1414
- run: yarn install
15-
- run: yarn lint
16-
- run: yarn tsc --noEmit
15+
- run: yarn biome:check

biome.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"organizeImports": {
4+
"enabled": true
5+
},
6+
"linter": {
7+
"enabled": true,
8+
"rules": {
9+
"recommended": true
10+
}
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space",
15+
"indentWidth": 2
16+
},
17+
"files": {
18+
"ignore": [".next", "node_modules", "backend"]
19+
}
20+
}

bun.lock

Lines changed: 15 additions & 586 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

Lines changed: 0 additions & 25 deletions
This file was deleted.

next.config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@ import type { NextConfig } from "next";
33
const nextConfig: NextConfig = {
44
reactStrictMode: true,
55
images: {
6-
domains: ['hc-cdn.hel1.your-objectstorage.com', 'ui-avatars.com'],
6+
domains: ["hc-cdn.hel1.your-objectstorage.com", "ui-avatars.com"],
77
},
88
async redirects() {
99
return [
1010
{
11-
source: '/404',
12-
destination: '/?404',
11+
source: "/404",
12+
destination: "/?404",
1313
permanent: false,
1414
},
1515
];

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,10 @@
66
"dev": "next dev --turbopack",
77
"build": "next build --turbopack",
88
"start": "next start",
9-
"lint": "eslint",
10-
"lint:fix": "eslint --fix"
9+
"biome:check": "biome check .",
10+
"biome:fix": "biome check --write .",
11+
"lint": "biome lint .",
12+
"format": "biome format --write ."
1113
},
1214
"dependencies": {
1315
"clsx": "^2.1.1",
@@ -19,15 +21,14 @@
1921
"swr": "^2.3.8"
2022
},
2123
"devDependencies": {
22-
"@eslint/eslintrc": "^3.3.3",
24+
"@biomejs/biome": "^1.9.4",
2325
"@tailwindcss/postcss": "^4.1.18",
2426
"@types/bun": "^1.3.6",
2527
"@types/node": "^20.19.29",
2628
"@types/react": "^19.2.8",
2729
"@types/react-dom": "^19.2.3",
28-
"eslint": "^9.39.2",
29-
"eslint-config-next": "15.5.6",
3030
"tailwindcss": "^4.1.18",
3131
"typescript": "^5.9.3"
32-
}
32+
},
33+
"trustedDependencies": ["@biomejs/biome"]
3334
}

src/app/api/dashboard/devlogs/route.ts

Lines changed: 17 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextRequest, NextResponse } from "next/server";
1+
import { type NextRequest, NextResponse } from "next/server";
22

33
export async function POST(req: NextRequest) {
44
const sessionId = req.cookies.get("sessionId")?.value;
@@ -7,7 +7,12 @@ export async function POST(req: NextRequest) {
77
return NextResponse.json({ error: "Unauthorized" }, { status: 401 });
88
}
99

10-
let data: { project_id: string; content: string; media_url?: string; description?: string | null };
10+
let data: {
11+
project_id: string;
12+
content: string;
13+
media_url?: string;
14+
description?: string | null;
15+
};
1116
try {
1217
data = await req.json();
1318
} catch {
@@ -17,14 +22,17 @@ export async function POST(req: NextRequest) {
1722
data.description = null;
1823
}
1924
try {
20-
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/v1/devlogs/`, {
21-
method: "POST",
22-
headers: {
23-
"Content-Type": "application/json",
24-
Cookie: `sessionId=${sessionId}`,
25+
const res = await fetch(
26+
`${process.env.NEXT_PUBLIC_API_URL}/api/v1/devlogs/`,
27+
{
28+
method: "POST",
29+
headers: {
30+
"Content-Type": "application/json",
31+
Cookie: `sessionId=${sessionId}`,
32+
},
33+
body: JSON.stringify(data),
2534
},
26-
body: JSON.stringify(data),
27-
});
35+
);
2836

2937
const text = await res.text();
3038
let json: unknown = null;

src/app/api/dashboard/projects/route.ts

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { NextRequest, NextResponse } from "next/server";
1+
import { type NextRequest, NextResponse } from "next/server";
22

33
export async function POST(req: NextRequest) {
44
const sessionId = req.cookies.get("sessionId")?.value;
@@ -15,14 +15,17 @@ export async function POST(req: NextRequest) {
1515
}
1616

1717
try {
18-
const res = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/v1/projects/`, {
19-
method: "POST",
20-
headers: {
21-
"Content-Type": "application/json",
22-
Cookie: `sessionId=${sessionId}`,
18+
const res = await fetch(
19+
`${process.env.NEXT_PUBLIC_API_URL}/api/v1/projects/`,
20+
{
21+
method: "POST",
22+
headers: {
23+
"Content-Type": "application/json",
24+
Cookie: `sessionId=${sessionId}`,
25+
},
26+
body: JSON.stringify(data),
2327
},
24-
body: JSON.stringify(data),
25-
});
28+
);
2629

2730
const text = await res.text();
2831
let json: unknown = null;

src/app/api/git/route.ts

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,29 @@
11
import { NextResponse } from "next/server";
22

3-
let cache: {
4-
hash: string
5-
message: string
6-
} | undefined
3+
let cache:
4+
| {
5+
hash: string;
6+
message: string;
7+
}
8+
| undefined;
79

810
export async function GET() {
911
if (!cache) {
1012
const githubRes = await fetch(
11-
"https://api.github.com/repos/hackclub/aces/commits/main"
12-
)
13+
"https://api.github.com/repos/hackclub/aces/commits/main",
14+
);
1315

1416
if (!githubRes.ok) {
15-
throw new Error(`GitHub API error: ${githubRes.status}`)
17+
throw new Error(`GitHub API error: ${githubRes.status}`);
1618
}
1719

18-
const json = await githubRes.json()
20+
const json = await githubRes.json();
1921

2022
cache = {
2123
hash: json.sha.substring(0, 7),
2224
message: json.commit.message,
23-
}
25+
};
2426
}
2527

26-
return NextResponse.json(cache)
28+
return NextResponse.json(cache);
2729
}

src/app/api/hackatime/projects/route.ts

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,18 @@ export async function GET() {
1010
}
1111

1212
// First, get user info to retrieve hackatime_id
13-
const userRes = await fetch(`${process.env.NEXT_PUBLIC_API_URL}/api/v1/users/me`, {
14-
headers: { Cookie: `sessionId=${sessionId}` },
15-
});
13+
const userRes = await fetch(
14+
`${process.env.NEXT_PUBLIC_API_URL}/api/v1/users/me`,
15+
{
16+
headers: { Cookie: `sessionId=${sessionId}` },
17+
},
18+
);
1619

1720
if (!userRes.ok) {
18-
return NextResponse.json({ detail: "Failed to fetch user" }, { status: userRes.status });
21+
return NextResponse.json(
22+
{ detail: "Failed to fetch user" },
23+
{ status: userRes.status },
24+
);
1925
}
2026

2127
const user = await userRes.json();
@@ -28,20 +34,23 @@ export async function GET() {
2834
// Fetch all Hackatime projects for this user
2935
const hackatimeRes = await fetch(
3036
`https://hackatime.hackclub.com/api/v1/users/${hackatimeId}/stats?features=projects&start_date=2025-12-21T00:00:00Z`,
31-
{ cache: "no-store" }
37+
{ cache: "no-store" },
3238
);
3339

3440
if (!hackatimeRes.ok) {
35-
return NextResponse.json({ detail: "Failed to fetch Hackatime data" }, { status: 500 });
41+
return NextResponse.json(
42+
{ detail: "Failed to fetch Hackatime data" },
43+
{ status: 500 },
44+
);
3645
}
3746

3847
const hackatimeData = await hackatimeRes.json();
3948
const projects = hackatimeData?.data?.projects || [];
4049

4150
const projectMap: Record<string, number> = {};
42-
projects.forEach((p: { name: string; total_seconds: number }) => {
51+
for (const p of projects as { name: string; total_seconds: number }[]) {
4352
projectMap[p.name] = p.total_seconds;
44-
});
53+
}
4554

4655
return NextResponse.json(projectMap);
4756
}

0 commit comments

Comments
 (0)