Skip to content

Commit 10ffb66

Browse files
aster-voidclaude
andcommitted
treewide: migrate from ESLint/Prettier to Biome
- Add Biome for linting and formatting .ts/.js/.css files - Keep Prettier for Svelte files only (Biome can't parse Svelte templates) - Enable Tailwind CSS class sorting via useSortedClasses - Enable noFloatingPromises rule - Use Prettier-style formatting (2 spaces, trailing commas) - Update tsconfig: disable noPropertyAccessFromIndexSignature - Remove ESLint and related dependencies 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <[email protected]>
1 parent 694db3b commit 10ffb66

File tree

104 files changed

+6808
-7071
lines changed

Some content is hidden

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

104 files changed

+6808
-7071
lines changed

.prettierignore

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,3 @@
1-
# Package Managers
2-
package-lock.json
3-
pnpm-lock.yaml
4-
yarn.lock
5-
bun.lock
6-
bun.lockb
7-
8-
# Miscellaneous
9-
/static/
10-
/drizzle/
1+
# Prettier only handles Svelte files (Biome handles the rest)
2+
*
3+
!**/*.svelte

.prettierrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
printWidth: 100
2+
useTabs: false
3+
tabWidth: 2
24
plugins:
35
- prettier-plugin-svelte
46
- prettier-plugin-tailwindcss

biome.json

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.10/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": true,
10+
"includes": ["**", "!**/*.svelte"]
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space",
15+
"indentWidth": 2,
16+
"lineWidth": 100
17+
},
18+
"linter": {
19+
"enabled": true,
20+
"rules": {
21+
"recommended": true,
22+
"nursery": {
23+
"noFloatingPromises": "error",
24+
"useSortedClasses": {
25+
"level": "error",
26+
"fix": "safe",
27+
"options": {
28+
"functions": ["clsx", "cva", "tw"]
29+
}
30+
}
31+
}
32+
}
33+
},
34+
"javascript": {
35+
"formatter": {
36+
"quoteStyle": "double",
37+
"trailingCommas": "all"
38+
}
39+
},
40+
"css": {
41+
"parser": {
42+
"cssModules": true,
43+
"tailwindDirectives": true
44+
}
45+
}
46+
}

bun.lock

Lines changed: 21 additions & 223 deletions
Large diffs are not rendered by default.

drizzle/meta/0000_snapshot.json

Lines changed: 19 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -111,12 +111,8 @@
111111
"name": "account_user_id_user_id_fk",
112112
"tableFrom": "account",
113113
"tableTo": "user",
114-
"columnsFrom": [
115-
"user_id"
116-
],
117-
"columnsTo": [
118-
"id"
119-
],
114+
"columnsFrom": ["user_id"],
115+
"columnsTo": ["id"],
120116
"onDelete": "cascade",
121117
"onUpdate": "no action"
122118
}
@@ -230,12 +226,8 @@
230226
"name": "article_author_id_member_id_fk",
231227
"tableFrom": "article",
232228
"tableTo": "member",
233-
"columnsFrom": [
234-
"author_id"
235-
],
236-
"columnsTo": [
237-
"id"
238-
],
229+
"columnsFrom": ["author_id"],
230+
"columnsTo": ["id"],
239231
"onDelete": "set null",
240232
"onUpdate": "no action"
241233
}
@@ -245,9 +237,7 @@
245237
"article_slug_unique": {
246238
"name": "article_slug_unique",
247239
"nullsNotDistinct": false,
248-
"columns": [
249-
"slug"
250-
]
240+
"columns": ["slug"]
251241
}
252242
},
253243
"policies": {},
@@ -337,12 +327,8 @@
337327
"name": "member_user_id_user_id_fk",
338328
"tableFrom": "member",
339329
"tableTo": "user",
340-
"columnsFrom": [
341-
"user_id"
342-
],
343-
"columnsTo": [
344-
"id"
345-
],
330+
"columnsFrom": ["user_id"],
331+
"columnsTo": ["id"],
346332
"onDelete": "set null",
347333
"onUpdate": "no action"
348334
}
@@ -352,16 +338,12 @@
352338
"member_user_id_unique": {
353339
"name": "member_user_id_unique",
354340
"nullsNotDistinct": false,
355-
"columns": [
356-
"user_id"
357-
]
341+
"columns": ["user_id"]
358342
},
359343
"member_slug_unique": {
360344
"name": "member_slug_unique",
361345
"nullsNotDistinct": false,
362-
"columns": [
363-
"slug"
364-
]
346+
"columns": ["slug"]
365347
}
366348
},
367349
"policies": {},
@@ -449,9 +431,7 @@
449431
"project_slug_unique": {
450432
"name": "project_slug_unique",
451433
"nullsNotDistinct": false,
452-
"columns": [
453-
"slug"
454-
]
434+
"columns": ["slug"]
455435
}
456436
},
457437
"policies": {},
@@ -510,25 +490,17 @@
510490
"name": "project_member_project_id_project_id_fk",
511491
"tableFrom": "project_member",
512492
"tableTo": "project",
513-
"columnsFrom": [
514-
"project_id"
515-
],
516-
"columnsTo": [
517-
"id"
518-
],
493+
"columnsFrom": ["project_id"],
494+
"columnsTo": ["id"],
519495
"onDelete": "cascade",
520496
"onUpdate": "no action"
521497
},
522498
"project_member_member_id_member_id_fk": {
523499
"name": "project_member_member_id_member_id_fk",
524500
"tableFrom": "project_member",
525501
"tableTo": "member",
526-
"columnsFrom": [
527-
"member_id"
528-
],
529-
"columnsTo": [
530-
"id"
531-
],
502+
"columnsFrom": ["member_id"],
503+
"columnsTo": ["id"],
532504
"onDelete": "cascade",
533505
"onUpdate": "no action"
534506
}
@@ -616,12 +588,8 @@
616588
"name": "session_user_id_user_id_fk",
617589
"tableFrom": "session",
618590
"tableTo": "user",
619-
"columnsFrom": [
620-
"user_id"
621-
],
622-
"columnsTo": [
623-
"id"
624-
],
591+
"columnsFrom": ["user_id"],
592+
"columnsTo": ["id"],
625593
"onDelete": "cascade",
626594
"onUpdate": "no action"
627595
}
@@ -631,9 +599,7 @@
631599
"session_token_unique": {
632600
"name": "session_token_unique",
633601
"nullsNotDistinct": false,
634-
"columns": [
635-
"token"
636-
]
602+
"columns": ["token"]
637603
}
638604
},
639605
"policies": {},
@@ -703,9 +669,7 @@
703669
"user_email_unique": {
704670
"name": "user_email_unique",
705671
"nullsNotDistinct": false,
706-
"columns": [
707-
"email"
708-
]
672+
"columns": ["email"]
709673
}
710674
},
711675
"policies": {},
@@ -791,4 +755,4 @@
791755
"schemas": {},
792756
"tables": {}
793757
}
794-
}
758+
}

drizzle/meta/_journal.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
"breakpoints": true
1111
}
1212
]
13-
}
13+
}

eslint.config.js

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

package.json

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@
1111
"prepare": "svelte-kit sync",
1212
"test-check": "bun test",
1313
"check": "bun type-check && bun test-check && bun lint-check && bun format-check",
14-
"fix": "bun lint-fix && bun format",
15-
"tidy": "bun type-check && bun test-check && bun --bun lint-fix --quiet && bun --bun format --log-level silent",
14+
"fix": "biome check --fix && prettier --write .",
15+
"tidy": "bun type-check && bun test-check && biome check --fix && prettier --write .",
1616
"type-check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
1717
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
18-
"format": "prettier --write .",
19-
"format-check": "prettier --check .",
20-
"lint-check": "eslint .",
18+
"format": "biome format --write . && prettier --write .",
19+
"format-check": "biome format . && prettier --check .",
20+
"lint-check": "biome lint .",
2121
"lint": "bun lint-check",
22-
"lint-fix": "eslint . --fix",
22+
"lint-fix": "biome lint --fix .",
2323
"db": "drizzle-kit",
2424
"up": "bun db push --force && devenv processes up -d",
2525
"down": "devenv processes down",
@@ -28,8 +28,7 @@
2828
"logs": "tail -f ./.devenv/processes.log"
2929
},
3030
"devDependencies": {
31-
"@eslint/compat": "^1.4.0",
32-
"@eslint/js": "^9.39.1",
31+
"@biomejs/biome": "^2.3.10",
3332
"@sveltejs/adapter-node": "^5.4.0",
3433
"@sveltejs/kit": "^2.49.1",
3534
"@sveltejs/vite-plugin-svelte": "^6.2.1",
@@ -40,19 +39,14 @@
4039
"daisyui": "^5.5.13",
4140
"drizzle-kit": "^0.31.8",
4241
"drizzle-orm": "^0.45.0",
43-
"eslint": "^9.39.1",
44-
"eslint-config-prettier": "^10.1.8",
45-
"eslint-plugin-svelte": "^3.13.1",
46-
"globals": "^16.5.0",
4742
"postgres": "^3.4.5",
4843
"prettier": "^3.7.4",
49-
"prettier-plugin-svelte": "^3.4.0",
44+
"prettier-plugin-svelte": "^3.4.1",
5045
"prettier-plugin-tailwindcss": "^0.7.2",
5146
"svelte": "^5.45.6",
5247
"svelte-check": "^4.3.4",
5348
"tailwindcss": "^4.1.17",
5449
"typescript": "^5.9.3",
55-
"typescript-eslint": "^8.48.1",
5650
"vite": "^7.2.6",
5751
"yaml": "^2.8.2"
5852
},

scripts/migrate-articles.ts

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,12 @@
1313
*/
1414

1515
import { readdir, readFile } from "node:fs/promises";
16-
import { join, dirname } from "node:path";
17-
import { parse as parseYaml } from "yaml";
18-
import { drizzle } from "drizzle-orm/libsql";
16+
import { dirname, join } from "node:path";
1917
import { createClient } from "@libsql/client";
20-
import { article, member } from "../src/lib/shared/models/schema";
2118
import { eq } from "drizzle-orm";
19+
import { drizzle } from "drizzle-orm/libsql";
20+
import { parse as parseYaml } from "yaml";
21+
import { article, member } from "../src/lib/shared/models/schema";
2222

2323
// Create database client directly (not using SvelteKit path aliases)
2424
const DATABASE_URL = process.env.DATABASE_URL;
@@ -104,7 +104,7 @@ function generateExcerpt(content: string, maxLength = 200): string {
104104
.trim();
105105

106106
if (plain.length <= maxLength) return plain;
107-
return plain.slice(0, maxLength).replace(/\s+\S*$/, "") + "...";
107+
return `${plain.slice(0, maxLength).replace(/\s+\S*$/, "")}...`;
108108
}
109109

110110
async function findArticleFiles(): Promise<string[]> {
@@ -196,14 +196,14 @@ function extractErrorMessage(error: unknown): string {
196196

197197
// Truncate very long messages
198198
if (message.length > 200) {
199-
return message.slice(0, 200) + "...";
199+
return `${message.slice(0, 200)}...`;
200200
}
201201

202202
return message;
203203
}
204204

205205
async function migrateArticle(filePath: string, dryRun: boolean): Promise<MigrationResult> {
206-
const relPath = filePath.replace(ARTICLES_PATH + "/", "");
206+
const relPath = filePath.replace(`${ARTICLES_PATH}/`, "");
207207
const dirPath = dirname(relPath);
208208
const slug = generateSlug(dirPath);
209209

0 commit comments

Comments
 (0)