Skip to content

Commit 4da9ad7

Browse files
Migrate from prettier to oxfmt (#3960)
* Migrate from prettier to oxfmt * add back newlines --------- Co-authored-by: Aman Mahajan <amahajan@stratag.com>
1 parent d1df105 commit 4da9ad7

10 files changed

Lines changed: 83 additions & 41 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ jobs:
2828
- name: ESLint
2929
run: node --run eslint
3030

31-
- name: Prettier
32-
run: node --run prettier:check
31+
- name: Oxfmt
32+
run: node --run format:check
3333

3434
- name: Bundle
3535
run: node --run build

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ jobs:
3939
- name: ESLint
4040
run: node --run eslint
4141

42-
- name: Prettier
43-
run: node --run prettier:check
42+
- name: Oxfmt
43+
run: node --run format:check
4444

4545
- name: Bundle
4646
run: node --run build

.oxfmtrc.json

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"$schema": "./node_modules/oxfmt/configuration_schema.json",
3+
"ignorePatterns": ["/website/routeTree.gen.ts"],
4+
"singleQuote": true,
5+
"trailingComma": "none",
6+
"experimentalSortImports": {
7+
"customGroups": [
8+
{
9+
"groupName": "react",
10+
"elementNamePattern": ["react", "react/**", "react-dom", "react-dom/**"]
11+
},
12+
{
13+
"groupName": "ecij",
14+
"elementNamePattern": ["ecij"]
15+
},
16+
{
17+
"groupName": "clsx",
18+
"elementNamePattern": ["clsx"]
19+
},
20+
{
21+
"groupName": "./src",
22+
"elementNamePattern": ["**/src", "**/src/**"]
23+
},
24+
{
25+
"groupName": "./renderers",
26+
"elementNamePattern": ["**/renderers", "**/renderers/**"]
27+
},
28+
{
29+
"groupName": "./components",
30+
"elementNamePattern": ["**/components", "**/components/**"]
31+
},
32+
{
33+
"groupName": "./hooks",
34+
"elementNamePattern": ["**/hooks", "**/hooks/**"]
35+
},
36+
{
37+
"groupName": "./utils",
38+
"elementNamePattern": ["**/utils", "**/utils/**"]
39+
},
40+
{
41+
"groupName": "./types",
42+
"elementNamePattern": ["**/types", "**/types/**"]
43+
}
44+
],
45+
"groups": [
46+
"side_effect_style",
47+
"side_effect",
48+
{ "newlinesBetween": true },
49+
"builtin",
50+
"react",
51+
"external",
52+
"ecij",
53+
"clsx",
54+
{ "newlinesBetween": true },
55+
"./src",
56+
"./renderers",
57+
"./components",
58+
"./hooks",
59+
"./utils",
60+
"./types",
61+
"index",
62+
"sibling",
63+
"parent",
64+
"unknown"
65+
],
66+
"newlinesBetween": false
67+
},
68+
"experimentalSortPackageJson": false
69+
}

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.prettierrc

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

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
2-
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode", "biomejs.biome"]
2+
"recommendations": ["dbaeumer.vscode-eslint", "oxc.oxc-vscode", "biomejs.biome"]
33
}

.vscode/settings.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"editor.codeActionsOnSave": {
33
"source.fixAll": "explicit"
44
},
5-
"editor.defaultFormatter": "esbenp.prettier-vscode",
5+
"editor.defaultFormatter": "oxc.oxc-vscode",
66
"editor.formatOnSave": true,
7+
"editor.formatOnSaveMode": "file",
78
"typescript.enablePromptUseWorkspaceTsdk": true,
89
"typescript.tsdk": "node_modules/typescript/lib",
910
"files.readonlyInclude": {

package.json

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,19 @@
4040
"test:watch": "vitest watch --project browser --project node",
4141
"visual": "vitest run --project visual --coverage.reportsDirectory='./coverage/visual'",
4242
"visual:update": "vitest run --project visual --update",
43-
"format": "biome format --write",
43+
"format": "oxfmt",
44+
"format:check": "oxfmt --check",
4445
"check": "biome check --error-on-warnings",
4546
"biome:ci": "biome ci --error-on-warnings",
4647
"eslint": "eslint --max-warnings 0 --cache --cache-location .cache/eslint --cache-strategy content",
4748
"eslint:fix": "node --run eslint -- --fix",
48-
"prettier:check": "prettier --check .",
49-
"prettier:format": "prettier --write .",
5049
"typecheck": "tsc --build"
5150
},
5251
"devDependencies": {
5352
"@biomejs/biome": "2.4.0",
5453
"@eslint-react/eslint-plugin": "^2.3.12",
5554
"@eslint/markdown": "^7.5.1",
5655
"@faker-js/faker": "^10.0.0",
57-
"@ianvs/prettier-plugin-sort-imports": "^4.6.2",
5856
"@tanstack/react-router": "^1.132.31",
5957
"@tanstack/router-plugin": "^1.132.31",
6058
"@types/node": "^25.0.2",
@@ -76,9 +74,9 @@
7674
"eslint-plugin-testing-library": "^7.13.5",
7775
"jspdf": "^4.0.0",
7876
"jspdf-autotable": "^5.0.2",
77+
"oxfmt": "0.33.0",
7978
"playwright": "~1.58.0",
8079
"postcss": "^8.5.2",
81-
"prettier": "3.8.1",
8280
"react": "^19.2.1",
8381
"react-dom": "^19.2.1",
8482
"rolldown": "^1.0.0-rc.3",

src/Columns.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { useHeaderRowSelection, useRowSelection } from './hooks/useRowSelection';
1+
import { useHeaderRowSelection, useRowSelection } from './hooks';
22
import type { Column, RenderCellProps, RenderGroupCellProps, RenderHeaderCellProps } from './types';
33
import { SelectCellFormatter } from './cellRenderers';
44

test/setupBrowser.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import { configure } from 'vitest-browser-react/pure';
2-
import { locators } from 'vitest/browser';
3-
41
// vitest-browser-react also automatically injects render method on the page
52
// need to import it so TypeScript can pick up types
63
import 'vitest-browser-react';
74

5+
import { configure } from 'vitest-browser-react/pure';
6+
import { locators } from 'vitest/browser';
7+
88
configure({
99
reactStrictMode: true
1010
});

0 commit comments

Comments
 (0)