Skip to content
This repository was archived by the owner on Mar 9, 2026. It is now read-only.

Commit df8d1e1

Browse files
authored
chore: Convert formatter from Biome + Prettier to Oxfmt (#54)
1 parent 76042ae commit df8d1e1

11 files changed

Lines changed: 99 additions & 114 deletions

File tree

.github/renovate.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
3-
"extends": ["config:best-practices", "customManagers:biomeVersions"],
3+
"extends": ["config:best-practices"],
44
"timezone": "Asia/Tokyo",
55
"schedule": ["before 5am on Monday"],
66
"labels": ["dependencies"],

.github/workflows/ci.yml

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,7 @@ jobs:
8484
name: Status Check
8585
runs-on: ubuntu-slim
8686
timeout-minutes: 1
87-
needs:
88-
[
89-
setup,
90-
lint-format,
91-
type-check,
92-
test,
93-
export-validation,
94-
dependency-review,
95-
]
87+
needs: [setup, lint-format, type-check, test, export-validation, dependency-review]
9688
if: always() && (contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled'))
9789
steps:
9890
- run: exit 1

.oxfmtrc.json

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"useTabs": true,
4+
"tabWidth": 2,
5+
"printWidth": 100,
6+
"singleQuote": false,
7+
"jsxSingleQuote": false,
8+
"quoteProps": "as-needed",
9+
"trailingComma": "all",
10+
"semi": true,
11+
"arrowParens": "always",
12+
"bracketSameLine": false,
13+
"bracketSpacing": true,
14+
"overrides": [
15+
{
16+
"files": ["*.md", "*.{yml,yaml}"],
17+
"options": {
18+
"useTabs": false
19+
}
20+
}
21+
]
22+
}

CLAUDE.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,7 @@ bun run check:type:example
4848
| **tsup** | Build (bundler) |
4949
| **vitest** | Test runner |
5050
| **oxlint** | Linter |
51-
| **Biome** | Formatter (TS/JS/JSON) |
52-
| **Prettier** | Formatter (Markdown/YAML) |
51+
| **oxfmt** | Formatter (TS/JS/JSON) |
5352
| **publint** / **attw** | Package export validation |
5453
| **npm-run-all2** | Script orchestration |
5554

@@ -73,7 +72,7 @@ bun run test:watch # Watch mode for testing
7372
```bash
7473
bun run lint # oxlint (deny-warnings)
7574
bun run lint:fix # oxlint --fix-suggestions
76-
bun run format # Biome + Prettier (write)
75+
bun run format # oxfmt (write)
7776
bun run fix # lint:fix + format (all-in-one auto-fix)
7877
```
7978

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ It enforces strict rules on keys and forbids structural inference by design.
3030
- [Result](#result)
3131
- [Issues](#issues)
3232
- [Versioning](#versioning)
33+
- [Contributing](#contributing)
3334
- [License](#license)
3435

3536
---

biome.json

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

bun.lock

Lines changed: 43 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 24 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,30 @@
22
"name": "safe-formdata",
33
"version": "0.1.3",
44
"description": "Boundary-focused FormData parser with strict security guarantees",
5+
"keywords": [
6+
"boundary",
7+
"formdata",
8+
"parser",
9+
"prototype-pollution",
10+
"security"
11+
],
12+
"homepage": "https://github.com/roottool/safe-formdata#readme",
13+
"bugs": {
14+
"url": "https://github.com/roottool/safe-formdata/issues"
15+
},
16+
"license": "MIT",
517
"author": "roottool",
618
"repository": {
719
"type": "git",
820
"url": "git+https://github.com/roottool/safe-formdata.git"
921
},
10-
"bugs": {
11-
"url": "https://github.com/roottool/safe-formdata/issues"
12-
},
13-
"homepage": "https://github.com/roottool/safe-formdata#readme",
22+
"files": [
23+
"dist"
24+
],
25+
"type": "module",
26+
"main": "./dist/index.js",
27+
"module": "./dist/index.js",
28+
"types": "./dist/index.d.ts",
1429
"imports": {
1530
"#*": {
1631
"types": "./src/*.ts",
@@ -19,39 +34,26 @@
1934
},
2035
"#safe-formdata": "./src/index.ts"
2136
},
22-
"type": "module",
23-
"main": "./dist/index.js",
24-
"module": "./dist/index.js",
25-
"types": "./dist/index.d.ts",
2637
"exports": {
2738
".": {
2839
"types": "./dist/index.d.ts",
2940
"import": "./dist/index.js",
3041
"default": "./dist/index.js"
3142
}
3243
},
33-
"files": [
34-
"dist"
35-
],
3644
"scripts": {
3745
"dev": "tsup --watch",
3846
"lint": "oxlint . --deny-warnings",
3947
"lint:fix": "oxlint . --fix-suggestions",
40-
"format:biome": "biome check --write --assist-enabled true",
41-
"format:prettier": "prettier --cache --write \"**/*.{md,yml,yaml}\"",
42-
"format": "npm-run-all2 format:biome format:prettier",
48+
"format": "oxfmt",
4349
"fix": "npm-run-all2 lint:fix format",
44-
"check:biome": "biome check . --assist-enabled true",
45-
"check:prettier": "prettier --cache --check \"**/*.{md,yml,yaml}\"",
46-
"check:format": "npm-run-all2 check:biome check:prettier",
50+
"check:format": "oxfmt --check",
4751
"check:source": "npm-run-all2 lint check:format",
4852
"check": "bun run check:source",
4953
"check:type:source": "tsc --noEmit",
5054
"check:type:example": "tsc --project tsconfig.examples.json --noEmit",
5155
"check:type": "npm-run-all2 check:type:source check:type:example",
52-
"check:prettier:ci": "prettier --check \"**/*.{md,yml,yaml}\"",
53-
"check:format:ci": "npm-run-all2 check:biome check:prettier:ci",
54-
"check:source:ci": "npm-run-all2 lint check:format:ci",
56+
"check:source:ci": "npm-run-all2 lint check:format",
5557
"test": "vitest run",
5658
"test:watch": "vitest",
5759
"test:coverage": "vitest run --coverage",
@@ -61,25 +63,16 @@
6163
},
6264
"devDependencies": {
6365
"@arethetypeswrong/cli": "0.18.2",
64-
"@biomejs/biome": "2.3.10",
6566
"@types/node": "25.0.3",
6667
"@vitest/coverage-v8": "4.0.16",
6768
"happy-dom": "20.0.11",
6869
"npm-run-all2": "8.0.4",
70+
"oxfmt": "0.35.0",
6971
"oxlint": "1.34.0",
70-
"prettier": "3.7.4",
7172
"publint": "0.3.16",
7273
"terser": "5.44.1",
7374
"tsup": "8.5.1",
7475
"typescript": "5.9.3",
7576
"vitest": "4.0.16"
76-
},
77-
"license": "MIT",
78-
"keywords": [
79-
"formdata",
80-
"parser",
81-
"security",
82-
"boundary",
83-
"prototype-pollution"
84-
]
77+
}
8578
}

skills/boundary-validator/examples/bad-code.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -460,11 +460,7 @@ export function parse(formData: FormData, strict?: boolean): ParseResult {
460460

461461
```typescript
462462
// ❌ WRONG: Adding new issue code in minor version
463-
export type IssueCode =
464-
| "invalid_key"
465-
| "forbidden_key"
466-
| "duplicate_key"
467-
| "invalid_value"; // NEW - requires major version bump!
463+
export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key" | "invalid_value"; // NEW - requires major version bump!
468464

469465
// Problem: Breaking change without major version bump
470466
// Violates: API contract (IssueCode stability)

skills/boundary-validator/references/api-contract.md

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,7 @@ function parse(formData: FormData): ParseResult;
3434
function parse(formData: FormData, options: ParseOptions): ParseResult;
3535

3636
// Adding options
37-
function parse(
38-
formData: FormData,
39-
options?: { allowDuplicates?: boolean },
40-
): ParseResult;
37+
function parse(formData: FormData, options?: { allowDuplicates?: boolean }): ParseResult;
4138

4239
// Adding framework adapters
4340
function parseRequest(req: NextRequest): ParseResult;
@@ -191,11 +188,7 @@ export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key";
191188
export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key";
192189

193190
// v1.0.0 - Major version allows changes
194-
export type IssueCode =
195-
| "invalid_key"
196-
| "forbidden_key"
197-
| "duplicate_key"
198-
| "invalid_value"; // OK in major version
191+
export type IssueCode = "invalid_key" | "forbidden_key" | "duplicate_key" | "invalid_value"; // OK in major version
199192
```
200193

201194
---

0 commit comments

Comments
 (0)