Skip to content

Commit 5ac3e7d

Browse files
committed
install biome, apply biome, and setup ci
1 parent 49c2cf3 commit 5ac3e7d

File tree

23 files changed

+81
-75
lines changed

23 files changed

+81
-75
lines changed

.github/workflows/check.yml

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,21 @@ name: Check
22
on: pull_request
33
jobs:
44
build-type-check:
5-
name: Build and Type Check
5+
name: Check
66
runs-on: ubuntu-latest
77
steps:
88
- uses: actions/checkout@v3
9-
- uses: actions/setup-node@v3
9+
- uses: actions/setup-bun@v2
1010
with:
11-
node-version: "18"
12-
cache: npm
13-
- run: npm ci
14-
- uses: actions/cache@v3
11+
bun-version: "1.2.4"
12+
- run: bun install --frozen-lockfile
13+
- run: bun check
14+
- uses: actions/cache@v4
1515
with:
16-
key: ${{ runner.os }}-gatsby-build-${{ github.run_id }}
16+
key: ${{ runner.os }}-astro-build
1717
path: |
18-
.cache
19-
public
20-
restore-keys: ${{ runner.os }}-gatsby-build-
21-
- run: npm run build
22-
- run: npm run type-check
23-
24-
lint:
25-
name: Lint
26-
runs-on: ubuntu-latest
27-
steps:
28-
- uses: actions/checkout@v3
29-
- uses: actions/setup-node@v3
30-
with:
31-
node-version: "18"
32-
cache: npm
33-
- run: npm ci
34-
- run: npm run lint
18+
.astro
19+
dist
20+
node_modules/.astro/assets
21+
restore-keys: ${{ runner.os }}-astro-build
22+
- run: bun run build

bun.lock

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
},
1616
"devDependencies": {
1717
"@astrojs/check": "^0.9.4",
18+
"@biomejs/biome": "^1.9.4",
1819
"@tailwindcss/vite": "^4.0.12",
1920
"@types/bun": "^1.2.4",
2021
"lefthook": "^1.11.3",
@@ -61,6 +62,24 @@
6162

6263
"@babel/types": ["@babel/[email protected]", "", { "dependencies": { "@babel/helper-string-parser": "^7.25.9", "@babel/helper-validator-identifier": "^7.25.9" } }, "sha512-Y3IR1cRnOxOCDvMmNiym7XpXQ93iGDDPHx+Zj+NM+rg0fBaShfQLkg+hKPaZCEvg5N/LeCo4+Rj/i3FuJsIQaw=="],
6364

65+
"@biomejs/biome": ["@biomejs/[email protected]", "", { "optionalDependencies": { "@biomejs/cli-darwin-arm64": "1.9.4", "@biomejs/cli-darwin-x64": "1.9.4", "@biomejs/cli-linux-arm64": "1.9.4", "@biomejs/cli-linux-arm64-musl": "1.9.4", "@biomejs/cli-linux-x64": "1.9.4", "@biomejs/cli-linux-x64-musl": "1.9.4", "@biomejs/cli-win32-arm64": "1.9.4", "@biomejs/cli-win32-x64": "1.9.4" }, "bin": { "biome": "bin/biome" } }, "sha512-1rkd7G70+o9KkTn5KLmDYXihGoTaIGO9PIIN2ZB7UJxFrWw04CZHPYiMRjYsaDvVV7hP1dYNRLxSANLaBFGpog=="],
66+
67+
"@biomejs/cli-darwin-arm64": ["@biomejs/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-bFBsPWrNvkdKrNCYeAp+xo2HecOGPAy9WyNyB/jKnnedgzl4W4Hb9ZMzYNbf8dMCGmUdSavlYHiR01QaYR58cw=="],
68+
69+
"@biomejs/cli-darwin-x64": ["@biomejs/[email protected]", "", { "os": "darwin", "cpu": "x64" }, "sha512-ngYBh/+bEedqkSevPVhLP4QfVPCpb+4BBe2p7Xs32dBgs7rh9nY2AIYUL6BgLw1JVXV8GlpKmb/hNiuIxfPfZg=="],
70+
71+
"@biomejs/cli-linux-arm64": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-fJIW0+LYujdjUgJJuwesP4EjIBl/N/TcOX3IvIHJQNsAqvV2CHIogsmA94BPG6jZATS4Hi+xv4SkBBQSt1N4/g=="],
72+
73+
"@biomejs/cli-linux-arm64-musl": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "arm64" }, "sha512-v665Ct9WCRjGa8+kTr0CzApU0+XXtRgwmzIf1SeKSGAv+2scAlW6JR5PMFo6FzqqZ64Po79cKODKf3/AAmECqA=="],
74+
75+
"@biomejs/cli-linux-x64": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-lRCJv/Vi3Vlwmbd6K+oQ0KhLHMAysN8lXoCI7XeHlxaajk06u7G+UsFSO01NAs5iYuWKmVZjmiOzJ0OJmGsMwg=="],
76+
77+
"@biomejs/cli-linux-x64-musl": ["@biomejs/[email protected]", "", { "os": "linux", "cpu": "x64" }, "sha512-gEhi/jSBhZ2m6wjV530Yy8+fNqG8PAinM3oV7CyO+6c3CEh16Eizm21uHVsyVBEB6RIM8JHIl6AGYCv6Q6Q9Tg=="],
78+
79+
"@biomejs/cli-win32-arm64": ["@biomejs/[email protected]", "", { "os": "win32", "cpu": "arm64" }, "sha512-tlbhLk+WXZmgwoIKwHIHEBZUwxml7bRJgk0X2sPyNR3S93cdRq6XulAZRQJ17FYGGzWne0fgrXBKpl7l4M87Hg=="],
80+
81+
"@biomejs/cli-win32-x64": ["@biomejs/[email protected]", "", { "os": "win32", "cpu": "x64" }, "sha512-8Y5wMhVIPaWe6jw2H+KlEm4wP/f7EW3810ZLmDlrEEy5KvBsb9ECEfu/kMWD484ijfQ8+nIi0giMgu9g1UAuuA=="],
82+
6483
"@emmetio/abbreviation": ["@emmetio/[email protected]", "", { "dependencies": { "@emmetio/scanner": "^1.0.4" } }, "sha512-mgv58UrU3rh4YgbE/TzgLQwJ3pFsHHhCLqY20aJq+9comytTXUDNGG/SMtSeMJdkpxgXSXunBGLD8Boka3JyVA=="],
6584

6685
"@emmetio/css-abbreviation": ["@emmetio/[email protected]", "", { "dependencies": { "@emmetio/scanner": "^1.0.4" } }, "sha512-s9yjhJ6saOO/uk1V74eifykk2CBYi01STTK3WlXWGOepyKa23ymJ053+DNQjpFcy1ingpaO7AxCcwLvHFY9tuw=="],

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@
1212
"prepare": "lefthook install && bun sync",
1313
"sync": "astro sync",
1414
"dev": "astro dev",
15-
"check": "astro check",
15+
"check": "biome lint && astro check",
16+
"fix": "biome lint . --fix --unsafe",
1617
"build": "astro build",
1718
"preview": "astro preview",
1819
"lint": "eslint .",
@@ -31,6 +32,7 @@
3132
},
3233
"devDependencies": {
3334
"@astrojs/check": "^0.9.4",
35+
"@biomejs/biome": "^1.9.4",
3436
"@tailwindcss/vite": "^4.0.12",
3537
"@types/bun": "^1.2.4",
3638
"lefthook": "^1.11.3",

src/components/ActivityPage/Layout.astro

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2+
import { Image } from "astro:assets";
3+
import type { ImageMetadata } from "astro";
24
import GlobalLayout from "../../layouts/GlobalLayout.astro";
3-
import JoinUsCTA from "../JoinUsCTA.astro";
45
import { Focus } from "../../schema";
5-
import type { ImageMetadata } from "astro";
6-
import { Image } from "astro:assets";
6+
import JoinUsCTA from "../JoinUsCTA.astro";
77
88
interface Props {
99
type: string; // TODO: refine it more

src/components/ArticleList.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
2-
import { format } from "date-fns";
32
import { Image } from "astro:assets";
43
import { getCollection } from "astro:content";
4+
import { format } from "date-fns";
55
import { markdownToTxt } from "markdown-to-txt";
66
77
interface Props {

src/components/Footer.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
import ActionButton from "./ActionButton.astro";
3-
import Logo from "./Logo.astro";
43
import FooterSection from "./Footer/FooterSection.astro";
4+
import Logo from "./Logo.astro";
55
66
interface Props {
77
class?: string;

src/components/Header.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
import { ClientRouter } from "astro:transitions";
33
import { Icon } from "astro-icon/components";
44
5-
import Logo from "./Logo.astro";
6-
import { Focus } from "../schema.ts";
75
import banner from "../content/banner.ts";
6+
import { Focus } from "../schema.ts";
7+
import Logo from "./Logo.astro";
88
99
const links = [
1010
{ title: "プロジェクト", to: "/projects", focus: Focus.projects },

src/components/ProjectList.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ const props = Astro.props;
1010
const { variant = "full" } = props;
1111
1212
const projects = (await getCollection("projects")).sort((a, b) => {
13-
const a_order = a.data.order ?? Number.POSITIVE_INFINITY,
14-
b_order = b.data.order ?? Number.POSITIVE_INFINITY;
13+
const a_order = a.data.order ?? Number.POSITIVE_INFINITY;
14+
const b_order = b.data.order ?? Number.POSITIVE_INFINITY;
1515
if (a_order !== b_order) {
1616
return a_order - b_order;
1717
}

src/content.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import { glob } from "astro/loaders";
55

66
import {
77
CreateArticleSchema,
8-
CreateProjectSchema,
98
CreateMemberSchema,
9+
CreateProjectSchema,
1010
} from "./schema.ts";
1111

1212
const articles = defineCollection({

src/layouts/GlobalLayout.astro

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
22
import "../global.css";
3-
import Meta from "./meta.astro";
4-
import Header from "../components/Header.astro";
53
import Footer from "../components/Footer.astro";
4+
import Header from "../components/Header.astro";
65
import type { Focus } from "../schema";
6+
import Meta from "./meta.astro";
77
88
interface Props {
99
title: string | null;

0 commit comments

Comments
 (0)