Skip to content

Commit f68ef93

Browse files
Brian M Huntclaude
authored andcommitted
Replace ESLint + Prettier with Biome
Single Rust-native tool for linting + formatting (27x faster). Migrated config matches Prettier style + ESLint rules. New rules enabled: noUnusedImports, noUnusedVariables, noUnusedFunctionParameters (warn), noRedeclare, noFallthroughSwitchClause, useGetterReturn (error). Removed: eslint, @eslint/js, typescript-eslint, prettier, globals Added: @biomejs/biome CI: single `biome ci .` replaces Prettier + ESLint steps Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 65a063d commit f68ef93

9 files changed

Lines changed: 68 additions & 253 deletions

File tree

.github/workflows/lint-and-typecheck.yml

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,8 @@ jobs:
2121
- name: Install dependencies
2222
run: bun install --frozen-lockfile
2323

24-
- name: Check Prettier
25-
run: bun run format
26-
27-
- name: Check ESLint
28-
run: bun run lint
24+
- name: Check Biome (lint + format)
25+
run: bunx @biomejs/biome ci .
2926

3027
- name: Build (required for tsc)
3128
run: bun run build

.prettierignore

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

.prettierrc

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

AGENTS.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -38,10 +38,11 @@ All commands use Bun. Run from the repo root:
3838
bun install # Install all dependencies (uses Bun workspaces)
3939
bun run build # Build all packages (ESM, CommonJS, MJS, browser)
4040
bun run test # Run all tests (Vitest, headless Chromium via Playwright)
41-
bun run lint # Run ESLint
42-
bun run lint:fix # Run ESLint with auto-fix
43-
bun run format # Check Prettier formatting
44-
bun run format:fix # Fix Prettier formatting
41+
bun run check # Run Biome (lint + format)
42+
bun run lint # Run Biome lint only
43+
bun run lint:fix # Run Biome lint with auto-fix
44+
bun run format # Check Biome formatting
45+
bun run format:fix # Fix Biome formatting
4546
bun run tsc # TypeScript type-check (no emit)
4647
bun run dts # Generate TypeScript declaration files
4748
bun run clean # Clean dist/ and coverage/ dirs
@@ -62,12 +63,11 @@ because TKO does low-level DOM manipulation, MutationObserver, and event handlin
6263

6364
## Code Style
6465

65-
- **Formatter**: Prettier — no semicolons, single quotes, trailing commas: none, 120 char width
66-
- **Linter**: ESLint with typescript-eslint (flat config)
67-
- **Editor**: 2-space indentation for JS/TS, LF line endings
68-
- See `.prettierrc` and `eslint.config.js` for full config
66+
- **Linter + Formatter**: Biome — single Rust-native tool replacing ESLint + Prettier
67+
- **Style**: no semicolons, single quotes, trailing commas: none, 120 char width, 2-space indent, LF line endings
68+
- See `biome.json` for full config
6969

70-
Run `bun run format:fix && bun run lint:fix` before committing.
70+
Run `bun run lint:fix` before committing.
7171

7272
## TypeScript
7373

@@ -102,7 +102,7 @@ GitHub Actions workflows (`.github/workflows/`):
102102
|----------|---------|---------|
103103
| `main-build.yml` | Push to main | Build + audit + headless test |
104104
| `test-headless.yml` | PRs | Matrix test (Chrome, Firefox, jQuery) |
105-
| `lint-and-typecheck.yml` | PRs | Prettier + ESLint + tsc (combined) |
105+
| `lint-and-typecheck.yml` | PRs | Biome + tsc (lint, format, typecheck) |
106106
| `publish-check.yml` | PRs | Verify packages are publishable |
107107
| `release.yml` | Tag push (`v*`) | Changeset version PRs + npm publish + GitHub release creation |
108108
| `github-release.yml` | Manual fallback | Backfill a GitHub release/tag for a published `main` commit if automatic release creation needs a retry |

biome.json

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/2.4.12/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.4.11/schema.json",
33
"vcs": { "enabled": true, "clientKind": "git", "useIgnoreFile": true },
44
"files": {
55
"ignoreUnknown": true,
@@ -18,31 +18,47 @@
1818
"rules": {
1919
"recommended": true,
2020
"complexity": {
21-
"noUselessEscapeInRegex": "off"
21+
"noUselessEscapeInRegex": "off",
22+
"noArguments": "off",
23+
"noBannedTypes": "off",
24+
"useArrowFunction": "off",
25+
"noThisInStatic": "off"
2226
},
2327
"correctness": {
24-
"noUnusedVariables": "off",
25-
"noUnusedImports": "off"
28+
"noUnusedVariables": "warn",
29+
"noUnusedImports": "warn",
30+
"noUnusedFunctionParameters": "warn"
2631
},
2732
"style": {
2833
"useConst": "off",
2934
"useArrayLiterals": "off",
30-
"noNamespace": "off"
35+
"noNamespace": "off",
36+
"noNonNullAssertion": "off"
3137
},
3238
"suspicious": {
3339
"noExplicitAny": "off",
3440
"noAssignInExpressions": "off",
3541
"noMisleadingCharacterClass": "off",
3642
"noDoubleEquals": "off",
37-
"noRedeclare": "off",
43+
"noRedeclare": "error",
3844
"noShadowRestrictedNames": "off",
3945
"noControlCharactersInRegex": "off",
4046
"noEmptyBlockStatements": "off",
4147
"noPrototypeBuiltins": "off",
42-
"noFallthroughSwitchClause": "off"
48+
"noFallthroughSwitchClause": "error",
49+
"noImplicitAnyLet": "off",
50+
"noTemplateCurlyInString": "off",
51+
"useIterableCallbackReturn": "off",
52+
"noGlobalIsNan": "off",
53+
"noGlobalIsFinite": "off",
54+
"noThenProperty": "off",
55+
"useGetterReturn": "error"
4356
},
4457
"performance": {
4558
"noDelete": "off"
59+
},
60+
"security": {
61+
"noGlobalEval": "off"
4662
}
4763
}
4864
},
@@ -55,11 +71,6 @@
5571
}
5672
},
5773
"assist": {
58-
"enabled": true,
59-
"actions": {
60-
"source": {
61-
"organizeImports": "on"
62-
}
63-
}
74+
"enabled": false
6475
}
6576
}

0 commit comments

Comments
 (0)