Skip to content

Commit c713274

Browse files
committed
feat(tooling): Replace ESLint with Biome
1 parent 6fefac2 commit c713274

30 files changed

+437
-2238
lines changed

.eslintrc.json

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

.github/workflows/eslint.yml renamed to .github/workflows/lint.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
name: ESLint
1+
name: Lint
22

33
on:
44
push:
55
branches: [main]
66
paths:
77
- "**.ts"
8+
- "**.js"
89
- "package.json"
910
- "pnpm-lock.yaml"
10-
- ".eslintrc.json"
11-
- ".eslintignore"
12-
- ".github/workflows/eslint.yml"
11+
- "biome.jsonc"
12+
- ".github/workflows/lint.yml"
1313
pull_request:
1414
branches: [main]
1515
paths:
1616
- "**.ts"
17+
- "**.js"
1718
- "package.json"
1819
- "pnpm-lock.yaml"
19-
- ".eslintrc.json"
20-
- ".eslintignore"
21-
- ".github/workflows/eslint.yml"
20+
- "biome.jsonc"
21+
- ".github/workflows/lint.yml"
2222

2323
jobs:
24-
eslint:
24+
lint:
2525
runs-on: ubuntu-latest
2626
steps:
2727
- uses: actions/checkout@v4
@@ -54,4 +54,4 @@ jobs:
5454
- name: Install dependencies
5555
run: pnpm i --frozen-lockfile
5656

57-
- run: pnpm run eslint
57+
- run: pnpm run lint

.lintstagedrc

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

.lintstagedrc.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"*.{ts,js,json,jsonc}": [
3+
"pnpm biome format --write --no-errors-on-unmatched",
4+
"pnpm biome lint --write --no-errors-on-unmatched"
5+
]
6+
}

.vscode/settings.json

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"editor.defaultFormatter": "biomejs.biome",
3+
"editor.formatOnSave": true,
4+
"editor.codeActionsOnSave": {
5+
"quickfix.biome": "explicit"
6+
},
7+
"[typescript]": {
8+
"editor.defaultFormatter": "biomejs.biome"
9+
},
10+
"[javascript]": {
11+
"editor.defaultFormatter": "biomejs.biome"
12+
},
13+
"[jsonc]": {
14+
"editor.defaultFormatter": "biomejs.biome"
15+
},
16+
"[json]": {
17+
"editor.defaultFormatter": "biomejs.biome"
18+
},
19+
}

ava.config.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@ export default {
66
extensions: {
77
ts: "module"
88
},
9-
files: [
10-
"src/**/*.test.ts"
11-
]
9+
files: ["src/**/*.test.ts"]
1210
}

biome.jsonc

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"linter": {
4+
"rules": {
5+
"recommended": true,
6+
"complexity": {
7+
"noForEach": "off"
8+
},
9+
"style": {
10+
"noParameterAssign": "off"
11+
},
12+
"suspicious": {
13+
"noGlobalIsNan": "off"
14+
}
15+
}
16+
},
17+
"formatter": {
18+
"indentStyle": "space"
19+
},
20+
"javascript": {
21+
"formatter": {
22+
"semicolons": "asNeeded",
23+
"bracketSpacing": false,
24+
"trailingCommas": "none",
25+
"arrowParentheses": "asNeeded"
26+
}
27+
},
28+
"json": {
29+
"formatter": {
30+
"trailingCommas": "none"
31+
}
32+
},
33+
"files": {
34+
"include": ["**/*.ts", "**/*.js"],
35+
"ignore": ["node_modules", "lib"]
36+
}
37+
}

package.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@
3737
},
3838
"types": "./lib/index.d.ts",
3939
"scripts": {
40-
"eslint": "eslint src/**/*.ts",
4140
"lint:types": "tsc --project tsconfig.json --noEmit",
42-
"lint": "pnpm eslint && pnpm lint:types",
41+
"lint": "pnpm biome && pnpm lint:types",
4342
"staged": "lint-staged",
4443
"coverage": "c8 pnpm test",
4544
"ci": "c8 pnpm test && c8 report --reporter=json",
@@ -49,17 +48,16 @@
4948
"prepare": "npx is-in-ci || husky install"
5049
},
5150
"devDependencies": {
51+
"@biomejs/biome": "1.8.3",
5252
"@changesets/changelog-github": "0.5.0",
5353
"@changesets/cli": "2.27.6",
54-
"@octetstream/eslint-config": "8.2.5",
5554
"@types/mime-types": "2.1.4",
5655
"@types/node": "20.14.2",
5756
"@types/sinon": "17.0.3",
5857
"ava": "6.1.3",
5958
"c8": "10.1.2",
6059
"cross-env": "7.0.3",
6160
"del-cli": "5.1.0",
62-
"eslint": "9.6.0",
6361
"formdata-node": "6.0.3",
6462
"husky": "9.0.11",
6563
"lint-staged": "15.2.7",

0 commit comments

Comments
 (0)