Skip to content

Commit e7acae6

Browse files
authored
chore: switch from prettier to oxfmt (#46)
1 parent 5a480ce commit e7acae6

10 files changed

Lines changed: 65 additions & 37 deletions

File tree

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,4 +90,4 @@ body:
9090
- label: I have provided clear reproduction steps
9191
required: true
9292
- label: This is a bug in the bot, not a Discord or API issue
93-
required: true
93+
required: true

.oxfmtrc.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"tabWidth": 2,
4+
"printWidth": 100,
5+
"sortPackageJson": false,
6+
"ignorePatterns": []
7+
}

.prettierrc

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

.vscode/settings.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
{
2-
"typescript.experimental.useTsgo": true
2+
"typescript.experimental.useTsgo": true,
3+
"editor.defaultFormatter": "oxc.oxc-vscode",
4+
"editor.formatOnSave": true
35
}

CLAUDE.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,13 @@ bun run db:seed # Seed default teams (RACheats)
1515
# Development
1616
bun run dev # Run with hot reload (--watch)
1717
bun run tsc # TypeScript type checking (via tsgo)
18+
bun run format # Format code with oxfmt
19+
bun run format:check # Check formatting without writing
1820
bun run lint # Run ESLint
1921
bun run lint:fix # Auto-fix linting issues
2022
bun run test # Run all tests (vitest)
2123
bun run test:watch # Run tests in watch mode (vitest)
22-
bun run verify # Run lint, type checking, and tests (comprehensive check)
24+
bun run verify # Run format check, lint, type checking, and tests
2325

2426
# Deployment
2527
bun run deploy-commands # Deploy slash commands to Discord (required after adding/modifying slash commands)

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,12 +112,14 @@ For production deployments, the bot is automatically deployed via Forge when cha
112112
- `bun deploy-commands` - Deploy slash commands to Discord
113113
- `bun db:generate` - Generate database migrations
114114
- `bun db:migrate` - Apply database migrations
115+
- `bun run format` - Format code with oxfmt
116+
- `bun run format:check` - Check formatting without writing
115117
- `bun lint` - Run ESLint
116118
- `bun lint:fix` - Run ESLint with auto-fix
117119
- `bun tsc` - Run TypeScript type checking (via tsgo)
118120
- `bun run test` - Run all tests
119121
- `bun run test:watch` - Run tests in watch mode
120-
- `bun verify` - Run lint, type checking, and tests (comprehensive check)
122+
- `bun verify` - Run format check, lint, type checking, and tests
121123

122124
## Commands
123125

bun.lock

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

drizzle.config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ export default defineConfig({
77
dbCredentials: {
88
url: "./rabot.db",
99
},
10-
});
10+
});

eslint.config.js

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import eslint from "@eslint/js";
22
import prettierConfig from "eslint-config-prettier";
33
import importPlugin from "eslint-plugin-import";
4-
import prettier from "eslint-plugin-prettier";
54
import simpleImportSort from "eslint-plugin-simple-import-sort";
65
import sortKeysShorthand from "eslint-plugin-sort-keys-shorthand";
76
import unicorn from "eslint-plugin-unicorn";
@@ -31,7 +30,6 @@ export default tseslint.config(
3130

3231
plugins: {
3332
"@typescript-eslint": tseslint.plugin,
34-
prettier,
3533
"simple-import-sort": simpleImportSort,
3634
unicorn,
3735
"sort-keys-shorthand": sortKeysShorthand,
@@ -109,14 +107,6 @@ export default tseslint.config(
109107
"unicorn/prefer-module": "off",
110108
"unicorn/prefer-node-protocol": "off",
111109
"unicorn/prefer-switch": "off",
112-
113-
"prettier/prettier": [
114-
"error",
115-
{
116-
tabWidth: 2,
117-
printWidth: 100,
118-
},
119-
],
120110
},
121111
},
122112

@@ -126,5 +116,5 @@ export default tseslint.config(
126116
rules: {
127117
"@typescript-eslint/no-explicit-any": "off", // Allow any in test files
128118
},
129-
}
119+
},
130120
);

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,13 @@
3030
"db:migrate": "bun run src/database/migrate.ts",
3131
"db:seed": "bun run src/database/seed-teams.ts",
3232
"tsc": "tsgo --noEmit",
33+
"format": "oxfmt",
34+
"format:check": "oxfmt --check",
3335
"lint": "eslint src --cache",
3436
"lint:fix": "eslint src --fix",
3537
"test": "vitest run",
3638
"test:watch": "vitest",
37-
"verify": "bun run lint:fix && bun run tsc && vitest run",
39+
"verify": "bun run format:check && bun run lint:fix && bun run tsc && vitest run",
3840
"postinstall": "git config core.hooksPath .hooks && chmod +x .hooks/*"
3941
},
4042
"dependencies": {
@@ -54,10 +56,10 @@
5456
"eslint-config-prettier": "^10.1.5",
5557
"eslint-import-resolver-typescript": "^4.4.4",
5658
"eslint-plugin-import": "^2.32.0",
57-
"eslint-plugin-prettier": "^5.5.1",
5859
"eslint-plugin-simple-import-sort": "^12.1.1",
5960
"eslint-plugin-sort-keys-shorthand": "^3.0.0",
6061
"eslint-plugin-unicorn": "^59.0.1",
62+
"oxfmt": "^0.35.0",
6163
"typescript-eslint": "^8.37.0",
6264
"vitest": "^4.0.18"
6365
}

0 commit comments

Comments
 (0)