Skip to content

Commit 997b2cf

Browse files
authored
Format code with biome v2 (#8)
1 parent 05a01f5 commit 997b2cf

File tree

17 files changed

+352
-778
lines changed

17 files changed

+352
-778
lines changed

.github/workflows/ci.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ jobs:
1313
strategy:
1414
matrix:
1515
os: [ubuntu-latest, macos-latest, windows-latest]
16-
node: [18, 20, 22, 24]
16+
node: [20, 22, 24]
1717
steps:
1818
- uses: actions/checkout@v4
1919
- uses: pnpm/action-setup@v4
@@ -34,25 +34,22 @@ jobs:
3434
- name: Set up browser tests
3535
working-directory: tests-browser
3636
run: pnpm install && pnpm exec playwright install chromium firefox
37-
if: matrix.node != 18
3837

3938
- name: Install webkit browser on macos
4039
working-directory: tests-browser
4140
run: pnpm exec playwright install
42-
if: matrix.node != 18 && matrix.os == 'macos-latest'
41+
if: matrix.os == 'macos-latest'
4342

4443
- name: Run browser tests (chromium)
4544
run: pnpm test:browser --browser=chromium
46-
if: matrix.node != 18
4745

4846
- name: Run browser tests (firefox)
4947
run: pnpm test:browser --browser=firefox
50-
if: matrix.node != 18
5148

5249
- name: Run browser tests (webkit)
5350
run: |
5451
pnpm test:browser --browser=webkit
55-
if: matrix.node != 18 && matrix.os == 'macos-latest'
52+
if: matrix.os == 'macos-latest'
5653

5754
check-runtimes:
5855
runs-on: ubuntu-latest

biome.jsonc

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/2.3.2/schema.json",
3+
"vcs": {
4+
"enabled": false,
5+
"clientKind": "git",
6+
"useIgnoreFile": false
7+
},
8+
"files": {
9+
"includes": [
10+
"**/src/**/*.ts",
11+
"**/tests/**/*.ts"
12+
],
13+
"ignoreUnknown": false
14+
},
15+
"formatter": {
16+
"enabled": true,
17+
"indentStyle": "space",
18+
"lineWidth": 90
19+
},
20+
"assist": {
21+
"actions": {
22+
"source": {
23+
"organizeImports": "on"
24+
}
25+
}
26+
},
27+
"linter": {
28+
"enabled": true,
29+
"rules": {
30+
"recommended": true,
31+
"style": {
32+
"noUselessElse": "off",
33+
"noInferrableTypes": "off",
34+
"useTemplate": "off",
35+
"noParameterAssign": "error",
36+
"useAsConstAssertion": "error",
37+
"useDefaultParameterLast": "error",
38+
"useEnumInitializers": "error",
39+
"useSelfClosingElements": "error",
40+
"useSingleVarDeclarator": "error",
41+
"noUnusedTemplateLiteral": "error",
42+
"useNumberNamespace": "error"
43+
}
44+
}
45+
},
46+
"javascript": {
47+
"formatter": {
48+
"quoteStyle": "double",
49+
"trailingCommas": "es5"
50+
}
51+
},
52+
"overrides": [
53+
{
54+
"includes": [
55+
"**/biome.jsonc"
56+
],
57+
"formatter": {
58+
"enabled": false
59+
}
60+
}
61+
]
62+
}

package.json

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"type": "git",
1212
"url": "git+https://github.com/ecies/js-ciphers.git"
1313
},
14-
"version": "0.2.4",
14+
"version": "0.2.5",
1515
"engines": {
1616
"node": ">=16",
1717
"bun": ">=1",
@@ -51,6 +51,8 @@
5151
}
5252
},
5353
"scripts": {
54+
"check": "biome check",
55+
"check:fix": "biome check --fix",
5456
"build": "npx tsc",
5557
"test": "vitest",
5658
"test:browser": "cd tests-browser && pnpm test"
@@ -59,15 +61,16 @@
5961
"@noble/ciphers": "^1.0.0"
6062
},
6163
"devDependencies": {
62-
"@types/node": "^24.0.10",
63-
"@vitest/coverage-v8": "^3.2.4",
64+
"@biomejs/biome": "2.3.2",
65+
"@types/node": "^24.9.2",
66+
"@vitest/coverage-v8": "^4.0.6",
6467
"typescript": "^5.8.3",
65-
"vitest": "^3.2.4"
68+
"vitest": "^4.0.6"
6669
},
6770
"pnpm": {
6871
"onlyBuiltDependencies": [
6972
"esbuild"
7073
]
7174
},
72-
"packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
75+
"packageManager": "pnpm@10.20.0+sha512.cf9998222162dd85864d0a8102e7892e7ba4ceadebbf5a31f9c2fce48dfce317a9c53b9f6464d1ef9042cba2e02ae02a9f7c143a2b438cd93c91840f0192b9dd"
7376
}

0 commit comments

Comments
 (0)