Skip to content

Commit 26ed111

Browse files
committed
Update biome configuration and dependencies
- Upgraded the Biome schema version from 1.2.2 to 2.0.0 in biome.json. - Refactored import organization settings to a new structure under "assist" in biome.json. - Added new linter rules for improved code quality in biome.json. - Updated @biomejs/biome dependency version to 2.0.0 in package.json and bun.lock. - Adjusted various import statements across the codebase for consistency and clarity.
1 parent f364e56 commit 26ed111

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+138
-134
lines changed

.github/workflows/code-quality.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,22 @@ jobs:
1616
pull-requests: write
1717
steps:
1818
- uses: actions/checkout@v4
19-
- name: Reviewdog (Checks)
20-
uses: mongolyy/reviewdog-action-biome@v1
21-
with:
22-
github_token: ${{ secrets.github_token }}
23-
reporter: github-pr-check
24-
level: error
25-
biome_flags: "--diagnostic-level=error"
26-
- name: Reviewdog (PR)
27-
uses: mongolyy/reviewdog-action-biome@v1
28-
with:
29-
github_token: ${{ secrets.github_token }}
30-
reporter: github-pr-review
31-
level: error
32-
biome_flags: "--diagnostic-level=error"
19+
- name: Setup Biome
20+
uses: biomejs/setup-biome@v2
21+
- name: Run Biome
22+
run: biome ci .
23+
# TODO: Uncomment this when `reviewdog-action-biome` supports Biome 2.0
24+
# - name: Reviewdog (Checks)
25+
# uses: mongolyy/reviewdog-action-biome@v1
26+
# with:
27+
# github_token: ${{ secrets.github_token }}
28+
# reporter: github-pr-check
29+
# level: error
30+
# biome_flags: "--diagnostic-level=error"
31+
# - name: Reviewdog (PR)
32+
# uses: mongolyy/reviewdog-action-biome@v1
33+
# with:
34+
# github_token: ${{ secrets.github_token }}
35+
# reporter: github-pr-review
36+
# level: error
37+
# biome_flags: "--diagnostic-level=error"

.github/workflows/tests.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ jobs:
1818
runs-on: ubuntu-latest
1919
strategy:
2020
matrix:
21-
bun: ['1.1.43', 'latest']
21+
bun: ['1.2.3', 'latest']
2222
steps:
2323
- uses: actions/checkout@v4
2424
- uses: actions/cache@v4
@@ -40,7 +40,7 @@ jobs:
4040
runs-on: ubuntu-latest
4141
strategy:
4242
matrix:
43-
bun: ['1.1.43', 'latest']
43+
bun: ['1.2.3', 'latest']
4444
services:
4545
postgres:
4646
image: postgres:16
@@ -97,13 +97,13 @@ jobs:
9797
runs-on: ubuntu-latest
9898
strategy:
9999
matrix:
100-
bun: ['1.1.43', 'latest']
100+
bun: ['1.2.3', 'latest']
101101
steps:
102102
- uses: actions/checkout@v4
103103
- uses: actions/cache@v4
104104
with:
105105
path: ~/.bun/install/cache
106-
key: ${{ runner.os }}-${{ matrix.bun }}-bun-${{ hashFiles('**/bun.lockb') }}
106+
key: ${{ runner.os }}-${{ matrix.bun }}-bun-${{ hashFiles('**/bun.lock') }}
107107
restore-keys: |
108108
${{ runner.os }}-${{ matrix.bun }}-bun-
109109
- name: Setup Bun

biome.json

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,11 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.2.2/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.0.0/schema.json",
33
"vcs": {
44
"enabled": true,
55
"useIgnoreFile": true,
66
"clientKind": "git"
77
},
8-
"organizeImports": {
9-
"enabled": true
10-
},
8+
"assist": { "actions": { "source": { "organizeImports": "on" } } },
119
"formatter": {
1210
"enabled": true,
1311
"indentStyle": "space",
@@ -26,7 +24,19 @@
2624
"linter": {
2725
"enabled": true,
2826
"rules": {
29-
"recommended": true
27+
"recommended": true,
28+
"style": {
29+
"noParameterAssign": "error",
30+
"useAsConstAssertion": "error",
31+
"useDefaultParameterLast": "error",
32+
"useEnumInitializers": "error",
33+
"useSelfClosingElements": "error",
34+
"useSingleVarDeclarator": "error",
35+
"noUnusedTemplateLiteral": "error",
36+
"useNumberNamespace": "error",
37+
"noInferrableTypes": "error",
38+
"noUselessElse": "error"
39+
}
3040
}
3141
}
3242
}

bun.lock

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

docs/.vitepress/config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { defineConfig } from 'vitepress';
2-
import { description, name, title } from '../../package.json';
2+
import { description, title } from '../../package.json';
33

44
// https://vitepress.dev/reference/site-config
55
export default defineConfig({

drizzle.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { env } from '@/core/env';
21
import { defineConfig } from 'drizzle-kit';
2+
import { env } from '@/core/env';
33

44
const dbCredentials = {
55
host: env.POSTGRES_HOST,

drizzle/reset.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { db } from '@/database/database.providers';
21
import { sql } from 'drizzle-orm';
2+
import { db } from '@/database/database.providers';
33

44
async function reset() {
55
console.log('⏳ Resetting database...');

drizzle/seed.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { exit } from 'node:process';
22
import { parseArgs } from 'node:util';
3+
import { reset, seed } from 'drizzle-seed';
34
import { articles, favoriteArticles } from '@/articles/articles.schema';
45
import { comments } from '@/comments/comments.schema';
56
import { env } from '@/core/env';
67
import { db } from '@/database/database.providers';
78
import { articleTags, tags } from '@/tags/tags.schema';
8-
import { users } from '@/users/users.schema';
9-
import { userFollows } from '@/users/users.schema';
10-
import { reset, seed } from 'drizzle-seed';
9+
import { userFollows, users } from '@/users/users.schema';
1110

1211
const { values } = parseArgs({
1312
args: Bun.argv,

env.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { defineEnv } from '@/core/env/define-env.util';
21
import { t } from 'elysia';
2+
import { defineEnv } from '@/core/env/define-env.util';
33

44
export default defineEnv({
55
POSTGRES_DB: t.String({

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@
4343
"radashi": "^12.5.1"
4444
},
4545
"devDependencies": {
46-
"@biomejs/biome": "^1.9.4",
46+
"@biomejs/biome": "2.0.0",
4747
"@types/node": "^24.0.3",
4848
"bun-types": "latest",
4949
"cross-env": "^7.0.3",
@@ -53,7 +53,9 @@
5353
"typescript": "^5.8.3",
5454
"vitepress": "^1.6.3"
5555
},
56-
"trustedDependencies": ["@biomejs/biome"],
56+
"trustedDependencies": [
57+
"@biomejs/biome"
58+
],
5759
"overrides": {
5860
"@sinclair/typebox": "0.34.34"
5961
}

0 commit comments

Comments
 (0)