Skip to content

Commit aacd70e

Browse files
committed
ci: Add biome to CI
1 parent cfa108a commit aacd70e

13 files changed

+221
-90
lines changed

.github/workflows/ci.yml

+19
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,25 @@ jobs:
3434

3535
- name: Typecheck
3636
run: pnpm typecheck
37+
format-lint:
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: pnpm/action-setup@v2
42+
- uses: actions/setup-node@v4
43+
with:
44+
node-version: 22
45+
cache: "pnpm"
46+
registry-url: https://registry.npmjs.org
47+
48+
- shell: bash
49+
run: corepack enable
50+
51+
- shell: bash
52+
run: pnpm install
53+
54+
- name: Format and lint
55+
run: pnpm exec biome ci
3756
test:
3857
runs-on: ubuntu-latest
3958
steps:

biome.json

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.9.4/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false,
10+
"ignore": []
11+
},
12+
"formatter": {
13+
"enabled": true,
14+
"indentStyle": "space",
15+
"indentWidth": 2
16+
},
17+
"organizeImports": {
18+
"enabled": true
19+
},
20+
"linter": {
21+
"enabled": true,
22+
"rules": {
23+
"recommended": true,
24+
"style": {
25+
"useImportType": "off",
26+
"noNonNullAssertion": "off"
27+
},
28+
"complexity": {
29+
"noForEach": "off"
30+
}
31+
}
32+
},
33+
"javascript": {
34+
"formatter": {
35+
"quoteStyle": "double"
36+
}
37+
}
38+
}

package.json

+7-11
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,13 @@
77
"type": "module",
88
"main": "dist/index.js",
99
"types": "dist/index.d.ts",
10-
"files": [
11-
"dist",
12-
"README.md",
13-
"LICENSE"
14-
],
10+
"files": ["dist", "README.md", "LICENSE"],
1511
"license": "MIT",
1612
"repository": {
1713
"type": "git",
1814
"url": "git+https://github.com/hoarder-app/liteque.git"
1915
},
20-
"keywords": [
21-
"sqlite",
22-
"queue"
23-
],
16+
"keywords": ["sqlite", "queue"],
2417
"dependencies": {
2518
"async-mutex": "^0.4.1",
2619
"drizzle-orm": "^0.33.0",
@@ -30,6 +23,7 @@
3023
"better-sqlite3": ">=7"
3124
},
3225
"devDependencies": {
26+
"@biomejs/biome": "^1.9.4",
3327
"@tsconfig/node21": "^21.0.3",
3428
"@types/better-sqlite3": "^7.6.11",
3529
"drizzle-kit": "^0.24.02",
@@ -40,8 +34,10 @@
4034
"build": "tsc -d && cp -r src/drizzle dist/drizzle",
4135
"typecheck": "tsc --noEmit",
4236
"test": "vitest",
43-
"format": "prettier . --ignore-path ../../.prettierignore",
44-
"lint": "eslint ."
37+
"format": "biome format",
38+
"format:fix": "biome format --write",
39+
"lint": "biome lint",
40+
"lint:fix": "biome lint --write"
4541
},
4642
"packageManager": "[email protected]+sha512.e5a7e52a4183a02d5931057f7a0dbff9d5e9ce3161e33fa68ae392125b79282a8a8a470a51dfc8a0ed86221442eb2fb57019b0990ed24fab519bf0e1bc5ccfc4"
4743
}

pnpm-lock.yaml

+91
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/drizzle/meta/0000_snapshot.json

+7-19
Original file line numberDiff line numberDiff line change
@@ -73,44 +73,32 @@
7373
"indexes": {
7474
"tasks_queue_idx": {
7575
"name": "tasks_queue_idx",
76-
"columns": [
77-
"queue"
78-
],
76+
"columns": ["queue"],
7977
"isUnique": false
8078
},
8179
"tasks_status_idx": {
8280
"name": "tasks_status_idx",
83-
"columns": [
84-
"status"
85-
],
81+
"columns": ["status"],
8682
"isUnique": false
8783
},
8884
"tasks_expire_at_idx": {
8985
"name": "tasks_expire_at_idx",
90-
"columns": [
91-
"expireAt"
92-
],
86+
"columns": ["expireAt"],
9387
"isUnique": false
9488
},
9589
"tasks_num_runs_left_idx": {
9690
"name": "tasks_num_runs_left_idx",
97-
"columns": [
98-
"numRunsLeft"
99-
],
91+
"columns": ["numRunsLeft"],
10092
"isUnique": false
10193
},
10294
"tasks_max_num_runs_idx": {
10395
"name": "tasks_max_num_runs_idx",
104-
"columns": [
105-
"maxNumRuns"
106-
],
96+
"columns": ["maxNumRuns"],
10797
"isUnique": false
10898
},
10999
"tasks_allocation_id_idx": {
110100
"name": "tasks_allocation_id_idx",
111-
"columns": [
112-
"allocationId"
113-
],
101+
"columns": ["allocationId"],
114102
"isUnique": false
115103
}
116104
},
@@ -126,4 +114,4 @@
126114
},
127115
"id": "3094773c-0138-46b2-b617-4b10093b0f53",
128116
"prevId": "00000000-0000-0000-0000-000000000000"
129-
}
117+
}

src/drizzle/meta/0001_snapshot.json

+8-23
Original file line numberDiff line numberDiff line change
@@ -82,52 +82,37 @@
8282
"indexes": {
8383
"tasks_queue_idx": {
8484
"name": "tasks_queue_idx",
85-
"columns": [
86-
"queue"
87-
],
85+
"columns": ["queue"],
8886
"isUnique": false
8987
},
9088
"tasks_status_idx": {
9189
"name": "tasks_status_idx",
92-
"columns": [
93-
"status"
94-
],
90+
"columns": ["status"],
9591
"isUnique": false
9692
},
9793
"tasks_expire_at_idx": {
9894
"name": "tasks_expire_at_idx",
99-
"columns": [
100-
"expireAt"
101-
],
95+
"columns": ["expireAt"],
10296
"isUnique": false
10397
},
10498
"tasks_num_runs_left_idx": {
10599
"name": "tasks_num_runs_left_idx",
106-
"columns": [
107-
"numRunsLeft"
108-
],
100+
"columns": ["numRunsLeft"],
109101
"isUnique": false
110102
},
111103
"tasks_max_num_runs_idx": {
112104
"name": "tasks_max_num_runs_idx",
113-
"columns": [
114-
"maxNumRuns"
115-
],
105+
"columns": ["maxNumRuns"],
116106
"isUnique": false
117107
},
118108
"tasks_allocation_id_idx": {
119109
"name": "tasks_allocation_id_idx",
120-
"columns": [
121-
"allocationId"
122-
],
110+
"columns": ["allocationId"],
123111
"isUnique": false
124112
},
125113
"tasks_queue_idempotencyKey_unique": {
126114
"name": "tasks_queue_idempotencyKey_unique",
127-
"columns": [
128-
"queue",
129-
"idempotencyKey"
130-
],
115+
"columns": ["queue", "idempotencyKey"],
131116
"isUnique": true
132117
}
133118
},
@@ -145,4 +130,4 @@
145130
"internal": {
146131
"indexes": {}
147132
}
148-
}
133+
}

src/drizzle/meta/_journal.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,4 @@
1717
"breakpoints": true
1818
}
1919
]
20-
}
20+
}

src/queue.test.ts

+1-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,7 @@
11
/* eslint-disable @typescript-eslint/require-await */
22
import { describe, expect, test } from "vitest";
33

4-
import {
5-
buildDBClient,
6-
SqliteQueue
7-
} from "./";
4+
import { SqliteQueue, buildDBClient } from "./";
85

96
interface Work {
107
increment: number;
@@ -37,7 +34,6 @@ describe("SqliteQueue", () => {
3734
pending_retry: 0,
3835
failed: 0,
3936
});
40-
4137
});
4238

4339
test("keep failed jobs", async () => {

0 commit comments

Comments
 (0)