Skip to content

Commit 5f64e93

Browse files
feyclaude
andauthored
chore: migrate to Biome and Vitest, bump Node to 26 (#62)
- replace ESLint (airbnb) with Biome (2-space, single quotes, semicolons) - replace Jest with Vitest (vitest.config.js, globals, __tests__ include) - remove ESLint/Jest dependencies, add @biomejs/biome and vitest - standardize CI: push+PR on main, Node 26.x, npm cache - bump engines.node to >=26.0 Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 76f8faa commit 5f64e93

10 files changed

Lines changed: 4894 additions & 12865 deletions

File tree

.eslintignore

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

.eslintrc.yml

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

.github/workflows/nodeci.yml

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,24 @@
11
name: Node CI
22

33
on:
4-
- push
5-
- pull_request
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- main
610

711
jobs:
812
build:
913
runs-on: ubuntu-latest
1014

11-
strategy:
12-
matrix:
13-
node-version: [14.x, 15.x, 16.x, 17.x, 18.x]
14-
1515
steps:
1616
- uses: actions/checkout@v6
17-
- name: Use Node.js ${{ matrix.node-version }}
17+
- name: Use Node.js
1818
uses: actions/setup-node@v6
1919
with:
20-
node-version: ${{ matrix.node-version }}
21-
- name: Check node version
22-
run: node -v
20+
node-version: '26.x'
21+
cache: 'npm'
2322
- name: Install
2423
run: make install
2524
- name: Run linter

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ test:
99
npm test -s
1010

1111
lint:
12-
npx eslint .
12+
npx biome check .
1313

1414
publish:
1515
npm publish --access public

__tests__/test.js

Lines changed: 20 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
// @ts-check
22

33
import {
4-
mkdir,
5-
mkfile,
6-
isFile,
4+
filter,
75
isDirectory,
6+
isFile,
87
map,
8+
mkdir,
9+
mkfile,
910
reduce,
10-
filter,
1111
} from '../index.js';
1212

1313
test('build', () => {
@@ -53,12 +53,7 @@ test('isDirectory', () => {
5353

5454
test('reduce', () => {
5555
const tree = mkdir('/', [
56-
mkdir('eTc', [
57-
mkdir('NgiNx'),
58-
mkdir('CONSUL', [
59-
mkfile('config.json'),
60-
]),
61-
]),
56+
mkdir('eTc', [mkdir('NgiNx'), mkdir('CONSUL', [mkfile('config.json')])]),
6257
mkfile('hOsts'),
6358
]);
6459
const actual = reduce((acc) => acc + 1, tree, 0);
@@ -73,12 +68,7 @@ test('reduce', () => {
7368

7469
test('map', () => {
7570
const tree = mkdir('/', [
76-
mkdir('eTc', [
77-
mkdir('NgiNx'),
78-
mkdir('CONSUL', [
79-
mkfile('config.json'),
80-
]),
81-
]),
71+
mkdir('eTc', [mkdir('NgiNx'), mkdir('CONSUL', [mkfile('config.json')])]),
8272
mkfile('hOsts'),
8373
]);
8474
const actual = map((n) => ({ ...n, name: n.name.toUpperCase() }), tree);
@@ -88,7 +78,10 @@ test('map', () => {
8878
{
8979
children: [
9080
{
91-
children: [], meta: {}, name: 'NGINX', type: 'directory',
81+
children: [],
82+
meta: {},
83+
name: 'NGINX',
84+
type: 'directory',
9285
},
9386
{
9487
children: [{ meta: {}, name: 'CONFIG.JSON', type: 'file' }],
@@ -114,12 +107,8 @@ test('map', () => {
114107
test('filter', () => {
115108
const tree = mkdir('/', [
116109
mkdir('etc', [
117-
mkdir('nginx', [
118-
mkdir('conf.d'),
119-
]),
120-
mkdir('consul', [
121-
mkfile('config.json'),
122-
]),
110+
mkdir('nginx', [mkdir('conf.d')]),
111+
mkdir('consul', [mkfile('config.json')]),
123112
]),
124113
mkfile('hosts'),
125114
]);
@@ -130,12 +119,14 @@ test('filter', () => {
130119
{
131120
children: [
132121
{
133-
children: [{
134-
children: [],
135-
meta: {},
136-
name: 'conf.d',
137-
type: 'directory',
138-
}],
122+
children: [
123+
{
124+
children: [],
125+
meta: {},
126+
name: 'conf.d',
127+
type: 'directory',
128+
},
129+
],
139130
meta: {},
140131
name: 'nginx',
141132
type: 'directory',

biome.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"$schema": "./node_modules/@biomejs/biome/configuration_schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
8+
"files": {
9+
"ignoreUnknown": false
10+
},
11+
"formatter": {
12+
"enabled": true,
13+
"indentStyle": "space",
14+
"indentWidth": 2
15+
},
16+
"linter": {
17+
"enabled": true,
18+
"rules": {
19+
"recommended": true
20+
}
21+
},
22+
"javascript": {
23+
"formatter": {
24+
"quoteStyle": "single",
25+
"semicolons": "always"
26+
}
27+
},
28+
"assist": {
29+
"enabled": true,
30+
"actions": {
31+
"source": {
32+
"organizeImports": "on"
33+
}
34+
}
35+
}
36+
}

index.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,11 @@ export const filter = (callbackFn, tree) => {
183183
}
184184

185185
return isDirectory(tree)
186-
? { ...tree, children: tree.children.map((n) => filter(callbackFn, n)).filter((v) => v) }
186+
? {
187+
...tree,
188+
children: tree.children
189+
.map((n) => filter(callbackFn, n))
190+
.filter((v) => v),
191+
}
187192
: tree;
188193
};

0 commit comments

Comments
 (0)