Skip to content

Commit 15facd6

Browse files
authored
chore: switch from prettier to oxfmt (#1595)
1 parent 444db6f commit 15facd6

11 files changed

Lines changed: 327 additions & 167 deletions

File tree

.github/renovate.json5

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@
4747
"minimumReleaseAge": null
4848
},
4949
{
50-
"groupName": "prettier",
51-
"matchPackageNames": ["prettier"],
50+
"groupName": "oxfmt",
51+
"matchPackageNames": ["oxfmt"],
5252
"minimumReleaseAge": null
5353
},
5454
{

.github/workflows/ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ jobs:
106106
run: pnpm run lint --format=github
107107

108108
- name: Check formatting
109-
run: pnpm prettier --check .
109+
run: pnpm run format:check
110110

111111
ts-check:
112112
runs-on: ubuntu-latest

.oxfmtrc.json

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"singleQuote": true,
4+
"trailingComma": "es5",
5+
"printWidth": 80,
6+
"sortPackageJson": false,
7+
"sortImports": {
8+
"groups": [
9+
["builtin", "external", "internal"],
10+
{ "newlinesBetween": false },
11+
["parent", "sibling", "index"]
12+
],
13+
"newlinesBetween": false,
14+
"order": "asc",
15+
"ignoreCase": true
16+
},
17+
"ignorePatterns": ["CHANGELOG.md"],
18+
"overrides": [
19+
{
20+
"files": ["*.json5"],
21+
"options": {
22+
"quoteProps": "preserve",
23+
"singleQuote": false,
24+
"trailingComma": "none"
25+
}
26+
}
27+
]
28+
}

.prettierignore

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

.prettierrc.js

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

.vscode/extensions.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
{
22
"recommendations": [
33
"editorconfig.editorconfig",
4-
"esbenp.prettier-vscode",
54
"kravets.vscode-publint",
65
"oxc.oxc-vscode",
76
"redhat.vscode-yaml",

.vscode/settings.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
{
22
"oxc.enable": true,
3+
"editor.defaultFormatter": "oxc.oxc-vscode",
4+
"editor.formatOnSave": true,
35

46
// Always use the `package.json`'s `typescript`
57
"typescript.tsdk": "node_modules/typescript/lib",

oxlint.config.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ export default defineConfig({
66
'docs/.vitepress/config.mts',
77
'docs/.vitepress/theme/index.ts',
88
'templates',
9-
'.prettierrc.js',
109
'test/jiti/migrations/**/*.js',
1110
'test/jiti/migrations/**/*.mjs',
1211
],
@@ -127,11 +126,11 @@ export default defineConfig({
127126
//#region unicorn
128127
'unicorn/filename-case': 'off',
129128
'unicorn/no-array-callback-reference': 'off', // reduces readability
130-
'unicorn/no-nested-ternary': 'off', // incompatible with prettier
129+
'unicorn/no-nested-ternary': 'off', // incompatible with formatter
131130
'unicorn/no-null': 'off', // incompatible with TypeScript
132131
'unicorn/no-object-as-default-parameter': 'off', // https://github.com/sindresorhus/eslint-plugin-unicorn/issues/2199
133132
'unicorn/no-zero-fractions': 'off', // deactivated to raise awareness of floating operations
134-
'unicorn/number-literal-case': 'off', // incompatible with prettier
133+
'unicorn/number-literal-case': 'off', // incompatible with formatter
135134
'unicorn/numeric-separators-style': 'off', // "magic numbers" may carry specific meaning
136135
'unicorn/prefer-string-slice': 'off', // string.substring is sometimes easier to use
137136
'unicorn/prefer-ternary': 'off', // ternaries aren't always better

package.json

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"scripts": {
66
"clean": "git clean -fdx --exclude .claude",
77
"build": "tsup-node",
8-
"format": "prettier --cache --write .",
8+
"format": "oxfmt",
9+
"format:check": "oxfmt --check",
910
"lint": "oxlint",
1011
"ts-check": "tsc",
1112
"test": "vitest",
@@ -22,25 +23,25 @@
2223
"preflight": "pnpm install && run-s format build lint test:update-snapshots ts-check"
2324
},
2425
"keywords": [
25-
"db",
26+
"api",
27+
"cockroach",
28+
"cockroachdb",
2629
"database",
30+
"db",
31+
"db-migrate",
32+
"expandable",
33+
"extensible",
2734
"migrate",
2835
"migration",
2936
"migrations",
3037
"migrator",
31-
"db-migrate",
32-
"sql",
3338
"pg",
3439
"postgre",
3540
"postgres",
3641
"postgresql",
37-
"cockroach",
38-
"cockroachdb",
39-
"extensible",
40-
"expandable",
41-
"programatic",
4242
"programable",
43-
"api"
43+
"programatic",
44+
"sql"
4445
],
4546
"homepage": "https://github.com/salsita/node-pg-migrate",
4647
"bugs": {
@@ -101,12 +102,10 @@
101102
"esbuild-fix-imports-plugin": "1.0.23",
102103
"node-pg-migrate": "file:.",
103104
"npm-run-all2": "8.0.4",
105+
"oxfmt": "0.43.0",
104106
"oxlint": "1.58.0",
105107
"oxlint-tsgolint": "0.19.0",
106108
"pg": "8.20.0",
107-
"prettier": "3.8.1",
108-
"prettier-plugin-organize-imports": "4.3.0",
109-
"prettier-plugin-pkg": "0.22.1",
110109
"testcontainers": "11.13.0",
111110
"tsup": "8.5.1",
112111
"typescript": "5.9.3",

0 commit comments

Comments
 (0)