diff --git a/.oxfmtrc.json b/.oxfmtrc.json new file mode 100644 index 00000000..b1ba4b41 --- /dev/null +++ b/.oxfmtrc.json @@ -0,0 +1,35 @@ +{ + "printWidth": 100, + "singleQuote": true, + "trailingComma": "es5", + "importOrder": [ + ".*styles.css$", + "", + "dayjs", + "^react$", + "^next$", + "^next/.*$", + "", + "", + "^@mantine/(.*)$", + "^@mantinex/(.*)$", + "^@mantine-tests/(.*)$", + "^@docs/(.*)$", + "^@/.*$", + "^../(?!.*\\.css$).*$", + "^./(?!.*\\.css$).*$", + "\\.module\\.css$", + "(?', - '', - '^@mantine/(.*)$', - '^@mantinex/(.*)$', - '^@mantine-tests/(.*)$', - '^@docs/(.*)$', - '^@/.*$', - '^../(?!.*.css$).*$', - '^./(?!.*.css$).*$', - '\\.css$', - ], - overrides: [ - { - files: '*.mdx', - options: { - printWidth: 70, - }, - }, - ], -}; - -export default config; \ No newline at end of file diff --git a/README.md b/README.md index 01d69d92..a04ce7b8 100644 --- a/README.md +++ b/README.md @@ -22,13 +22,13 @@ This template comes with the following features: - `typecheck` – checks TypeScript types - `lint` – runs ESLint -- `prettier:check` – checks files with Prettier +- `format:test` – checks files with oxfmt - `vitest` – runs vitest tests - `vitest:watch` – starts vitest watch -- `test` – runs `vitest`, `prettier:check`, `lint` and `typecheck` scripts +- `test` – runs `vitest`, `format:test`, `lint` and `typecheck` scripts ### Other scripts - `storybook` – starts storybook dev server - `storybook:build` – build production storybook bundle to `storybook-static` -- `prettier:write` – formats all files with Prettier +- `format:write` – formats all files with oxfmt diff --git a/package.json b/package.json index e5a7a182..24618076 100644 --- a/package.json +++ b/package.json @@ -11,11 +11,11 @@ "lint": "npm run eslint && npm run stylelint", "eslint": "eslint . --cache", "stylelint": "stylelint '**/*.css' --cache", - "prettier": "prettier --check \"**/*.{ts,tsx}\"", - "prettier:write": "prettier --write \"**/*.{ts,tsx}\"", + "format:test": "oxfmt --check \"**/*.{ts,tsx,css}\"", + "format:write": "oxfmt --write \"**/*.{ts,tsx,css}\"", "vitest": "vitest run", "vitest:watch": "vitest", - "test": "npm run typecheck && npm run prettier && npm run lint && npm run vitest && npm run build", + "test": "npm run typecheck && npm run format:test && npm run lint && npm run vitest && npm run build", "storybook": "storybook dev -p 6006", "storybook:build": "storybook build" }, @@ -28,7 +28,6 @@ }, "devDependencies": { "@eslint/js": "^9.37.0", - "@ianvs/prettier-plugin-sort-imports": "^4.7.0", "@storybook/addon-themes": "^10.0.0", "@storybook/react": "^10.0.0", "@storybook/react-vite": "^10.0.0", @@ -46,10 +45,10 @@ "eslint-plugin-react": "^7.37.5", "identity-obj-proxy": "^3.0.0", "jsdom": "^27.0.0", + "oxfmt": "^0.42.0", "postcss": "^8.5.6", "postcss-preset-mantine": "1.18.0", "postcss-simple-vars": "^7.0.1", - "prettier": "^3.6.2", "prop-types": "^15.8.1", "storybook": "^10.0.0", "stylelint": "^17.0.0", diff --git a/yarn.lock b/yarn.lock index 6b9287fd..8e144d9b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -59,7 +59,7 @@ __metadata: languageName: node linkType: hard -"@babel/code-frame@npm:^7.0.0, @babel/code-frame@npm:^7.25.9": +"@babel/code-frame@npm:^7.0.0": version: 7.26.2 resolution: "@babel/code-frame@npm:7.26.2" dependencies: @@ -162,19 +162,6 @@ __metadata: languageName: node linkType: hard -"@babel/generator@npm:^7.25.9, @babel/generator@npm:^7.26.2": - version: 7.26.2 - resolution: "@babel/generator@npm:7.26.2" - dependencies: - "@babel/parser": "npm:^7.26.2" - "@babel/types": "npm:^7.26.0" - "@jridgewell/gen-mapping": "npm:^0.3.5" - "@jridgewell/trace-mapping": "npm:^0.3.25" - jsesc: "npm:^3.0.2" - checksum: 10c0/167ebce8977142f5012fad6bd91da51ac52bcd752f2261a54b7ab605d928aebe57e21636cdd2a9c7757e552652c68d9fcb5d40b06fcb66e02d9ee7526e118a5c - languageName: node - linkType: hard - "@babel/generator@npm:^7.27.1": version: 7.27.1 resolution: "@babel/generator@npm:7.27.1" @@ -307,13 +294,6 @@ __metadata: languageName: node linkType: hard -"@babel/helper-string-parser@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/helper-string-parser@npm:7.25.9" - checksum: 10c0/7244b45d8e65f6b4338a6a68a8556f2cb161b782343e97281a5f2b9b93e420cad0d9f5773a59d79f61d0c448913d06f6a2358a87f2e203cf112e3c5b53522ee6 - languageName: node - linkType: hard - "@babel/helper-string-parser@npm:^7.27.1": version: 7.27.1 resolution: "@babel/helper-string-parser@npm:7.27.1" @@ -396,17 +376,6 @@ __metadata: languageName: node linkType: hard -"@babel/parser@npm:^7.25.9, @babel/parser@npm:^7.26.2": - version: 7.26.2 - resolution: "@babel/parser@npm:7.26.2" - dependencies: - "@babel/types": "npm:^7.26.0" - bin: - parser: ./bin/babel-parser.js - checksum: 10c0/751a743087b3a9172a7599f1421830d44c38f065ef781588d2bfb1c98f9b461719a226feb13c868d7a284783eee120c88ea522593118f2668f46ebfb1105c4d7 - languageName: node - linkType: hard - "@babel/parser@npm:^7.27.1": version: 7.27.1 resolution: "@babel/parser@npm:7.27.1" @@ -493,17 +462,6 @@ __metadata: languageName: node linkType: hard -"@babel/template@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/template@npm:7.25.9" - dependencies: - "@babel/code-frame": "npm:^7.25.9" - "@babel/parser": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - checksum: 10c0/ebe677273f96a36c92cc15b7aa7b11cc8bc8a3bb7a01d55b2125baca8f19cae94ff3ce15f1b1880fb8437f3a690d9f89d4e91f16fc1dc4d3eb66226d128983ab - languageName: node - linkType: hard - "@babel/template@npm:^7.27.1": version: 7.27.1 resolution: "@babel/template@npm:7.27.1" @@ -537,21 +495,6 @@ __metadata: languageName: node linkType: hard -"@babel/traverse@npm:^7.25.9": - version: 7.25.9 - resolution: "@babel/traverse@npm:7.25.9" - dependencies: - "@babel/code-frame": "npm:^7.25.9" - "@babel/generator": "npm:^7.25.9" - "@babel/parser": "npm:^7.25.9" - "@babel/template": "npm:^7.25.9" - "@babel/types": "npm:^7.25.9" - debug: "npm:^4.3.1" - globals: "npm:^11.1.0" - checksum: 10c0/e90be586a714da4adb80e6cb6a3c5cfcaa9b28148abdafb065e34cc109676fc3db22cf98cd2b2fff66ffb9b50c0ef882cab0f466b6844be0f6c637b82719bba1 - languageName: node - linkType: hard - "@babel/traverse@npm:^7.27.1": version: 7.27.1 resolution: "@babel/traverse@npm:7.27.1" @@ -623,16 +566,6 @@ __metadata: languageName: node linkType: hard -"@babel/types@npm:^7.25.9, @babel/types@npm:^7.26.0": - version: 7.26.0 - resolution: "@babel/types@npm:7.26.0" - dependencies: - "@babel/helper-string-parser": "npm:^7.25.9" - "@babel/helper-validator-identifier": "npm:^7.25.9" - checksum: 10c0/b694f41ad1597127e16024d766c33a641508aad037abd08d0d1f73af753e1119fa03b4a107d04b5f92cc19c095a594660547ae9bead1db2299212d644b0a5cb8 - languageName: node - linkType: hard - "@babel/types@npm:^7.27.1": version: 7.27.1 resolution: "@babel/types@npm:7.27.1" @@ -1244,34 +1177,6 @@ __metadata: languageName: node linkType: hard -"@ianvs/prettier-plugin-sort-imports@npm:^4.7.0": - version: 4.7.1 - resolution: "@ianvs/prettier-plugin-sort-imports@npm:4.7.1" - dependencies: - "@babel/generator": "npm:^7.26.2" - "@babel/parser": "npm:^7.26.2" - "@babel/traverse": "npm:^7.25.9" - "@babel/types": "npm:^7.26.0" - semver: "npm:^7.5.2" - peerDependencies: - "@prettier/plugin-oxc": ^0.0.4 || ^0.1.0 - "@vue/compiler-sfc": 2.7.x || 3.x - content-tag: ^4.0.0 - prettier: 2 || 3 || ^4.0.0-0 - prettier-plugin-ember-template-tag: ^2.1.0 - peerDependenciesMeta: - "@prettier/plugin-oxc": - optional: true - "@vue/compiler-sfc": - optional: true - content-tag: - optional: true - prettier-plugin-ember-template-tag: - optional: true - checksum: 10c0/cda335ef13b4f95825c7667a4962bd679c0065863572f9d3bd715f2d2a463e56e93808dc7b5c24ecca33d63ddf2159780cfdb3d78f30c828b6efb054972dfc5b - languageName: node - linkType: hard - "@isaacs/cliui@npm:^8.0.2": version: 8.0.2 resolution: "@isaacs/cliui@npm:8.0.2" @@ -1501,6 +1406,139 @@ __metadata: languageName: node linkType: hard +"@oxfmt/binding-android-arm-eabi@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-android-arm-eabi@npm:0.42.0" + conditions: os=android & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-android-arm64@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-android-arm64@npm:0.42.0" + conditions: os=android & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-darwin-arm64@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-darwin-arm64@npm:0.42.0" + conditions: os=darwin & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-darwin-x64@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-darwin-x64@npm:0.42.0" + conditions: os=darwin & cpu=x64 + languageName: node + linkType: hard + +"@oxfmt/binding-freebsd-x64@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-freebsd-x64@npm:0.42.0" + conditions: os=freebsd & cpu=x64 + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm-gnueabihf@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-arm-gnueabihf@npm:0.42.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm-musleabihf@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-arm-musleabihf@npm:0.42.0" + conditions: os=linux & cpu=arm + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm64-gnu@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-arm64-gnu@npm:0.42.0" + conditions: os=linux & cpu=arm64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-arm64-musl@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-arm64-musl@npm:0.42.0" + conditions: os=linux & cpu=arm64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-linux-ppc64-gnu@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-ppc64-gnu@npm:0.42.0" + conditions: os=linux & cpu=ppc64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-riscv64-gnu@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-riscv64-gnu@npm:0.42.0" + conditions: os=linux & cpu=riscv64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-riscv64-musl@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-riscv64-musl@npm:0.42.0" + conditions: os=linux & cpu=riscv64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-linux-s390x-gnu@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-s390x-gnu@npm:0.42.0" + conditions: os=linux & cpu=s390x & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-x64-gnu@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-x64-gnu@npm:0.42.0" + conditions: os=linux & cpu=x64 & libc=glibc + languageName: node + linkType: hard + +"@oxfmt/binding-linux-x64-musl@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-linux-x64-musl@npm:0.42.0" + conditions: os=linux & cpu=x64 & libc=musl + languageName: node + linkType: hard + +"@oxfmt/binding-openharmony-arm64@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-openharmony-arm64@npm:0.42.0" + conditions: os=openharmony & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-arm64-msvc@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-win32-arm64-msvc@npm:0.42.0" + conditions: os=win32 & cpu=arm64 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-ia32-msvc@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-win32-ia32-msvc@npm:0.42.0" + conditions: os=win32 & cpu=ia32 + languageName: node + linkType: hard + +"@oxfmt/binding-win32-x64-msvc@npm:0.42.0": + version: 0.42.0 + resolution: "@oxfmt/binding-win32-x64-msvc@npm:0.42.0" + conditions: os=win32 & cpu=x64 + languageName: node + linkType: hard + "@pkgjs/parseargs@npm:^0.11.0": version: 0.11.0 resolution: "@pkgjs/parseargs@npm:0.11.0" @@ -5879,7 +5917,6 @@ __metadata: resolution: "mantine-vite-template@workspace:." dependencies: "@eslint/js": "npm:^9.37.0" - "@ianvs/prettier-plugin-sort-imports": "npm:^4.7.0" "@mantine/core": "npm:8.3.18" "@mantine/hooks": "npm:8.3.18" "@storybook/addon-themes": "npm:^10.0.0" @@ -5899,10 +5936,10 @@ __metadata: eslint-plugin-react: "npm:^7.37.5" identity-obj-proxy: "npm:^3.0.0" jsdom: "npm:^27.0.0" + oxfmt: "npm:^0.42.0" postcss: "npm:^8.5.6" postcss-preset-mantine: "npm:1.18.0" postcss-simple-vars: "npm:^7.0.1" - prettier: "npm:^3.6.2" prop-types: "npm:^15.8.1" react: "npm:^19.2.0" react-dom: "npm:^19.2.0" @@ -6372,6 +6409,75 @@ __metadata: languageName: node linkType: hard +"oxfmt@npm:^0.42.0": + version: 0.42.0 + resolution: "oxfmt@npm:0.42.0" + dependencies: + "@oxfmt/binding-android-arm-eabi": "npm:0.42.0" + "@oxfmt/binding-android-arm64": "npm:0.42.0" + "@oxfmt/binding-darwin-arm64": "npm:0.42.0" + "@oxfmt/binding-darwin-x64": "npm:0.42.0" + "@oxfmt/binding-freebsd-x64": "npm:0.42.0" + "@oxfmt/binding-linux-arm-gnueabihf": "npm:0.42.0" + "@oxfmt/binding-linux-arm-musleabihf": "npm:0.42.0" + "@oxfmt/binding-linux-arm64-gnu": "npm:0.42.0" + "@oxfmt/binding-linux-arm64-musl": "npm:0.42.0" + "@oxfmt/binding-linux-ppc64-gnu": "npm:0.42.0" + "@oxfmt/binding-linux-riscv64-gnu": "npm:0.42.0" + "@oxfmt/binding-linux-riscv64-musl": "npm:0.42.0" + "@oxfmt/binding-linux-s390x-gnu": "npm:0.42.0" + "@oxfmt/binding-linux-x64-gnu": "npm:0.42.0" + "@oxfmt/binding-linux-x64-musl": "npm:0.42.0" + "@oxfmt/binding-openharmony-arm64": "npm:0.42.0" + "@oxfmt/binding-win32-arm64-msvc": "npm:0.42.0" + "@oxfmt/binding-win32-ia32-msvc": "npm:0.42.0" + "@oxfmt/binding-win32-x64-msvc": "npm:0.42.0" + tinypool: "npm:2.1.0" + dependenciesMeta: + "@oxfmt/binding-android-arm-eabi": + optional: true + "@oxfmt/binding-android-arm64": + optional: true + "@oxfmt/binding-darwin-arm64": + optional: true + "@oxfmt/binding-darwin-x64": + optional: true + "@oxfmt/binding-freebsd-x64": + optional: true + "@oxfmt/binding-linux-arm-gnueabihf": + optional: true + "@oxfmt/binding-linux-arm-musleabihf": + optional: true + "@oxfmt/binding-linux-arm64-gnu": + optional: true + "@oxfmt/binding-linux-arm64-musl": + optional: true + "@oxfmt/binding-linux-ppc64-gnu": + optional: true + "@oxfmt/binding-linux-riscv64-gnu": + optional: true + "@oxfmt/binding-linux-riscv64-musl": + optional: true + "@oxfmt/binding-linux-s390x-gnu": + optional: true + "@oxfmt/binding-linux-x64-gnu": + optional: true + "@oxfmt/binding-linux-x64-musl": + optional: true + "@oxfmt/binding-openharmony-arm64": + optional: true + "@oxfmt/binding-win32-arm64-msvc": + optional: true + "@oxfmt/binding-win32-ia32-msvc": + optional: true + "@oxfmt/binding-win32-x64-msvc": + optional: true + bin: + oxfmt: bin/oxfmt + checksum: 10c0/0fe0e0d1f2330b66a3e3df2dfeb013493831d7312a9c66f51a2a0814dfb2468f9d6cfd3a58d763dfd4a004db14baa157ada9645205b350af799c665f67d271d5 + languageName: node + linkType: hard + "p-limit@npm:^3.0.2": version: 3.1.0 resolution: "p-limit@npm:3.1.0" @@ -6674,15 +6780,6 @@ __metadata: languageName: node linkType: hard -"prettier@npm:^3.6.2": - version: 3.8.1 - resolution: "prettier@npm:3.8.1" - bin: - prettier: bin/prettier.cjs - checksum: 10c0/33169b594009e48f570471271be7eac7cdcf88a209eed39ac3b8d6d78984039bfa9132f82b7e6ba3b06711f3bfe0222a62a1bfb87c43f50c25a83df1b78a2c42 - languageName: node - linkType: hard - "pretty-format@npm:^27.0.2": version: 27.5.1 resolution: "pretty-format@npm:27.5.1" @@ -7291,15 +7388,6 @@ __metadata: languageName: node linkType: hard -"semver@npm:^7.5.2": - version: 7.6.3 - resolution: "semver@npm:7.6.3" - bin: - semver: bin/semver.js - checksum: 10c0/88f33e148b210c153873cb08cfe1e281d518aaa9a666d4d148add6560db5cd3c582f3a08ccb91f38d5f379ead256da9931234ed122057f40bb5766e65e58adaf - languageName: node - linkType: hard - "semver@npm:^7.7.3": version: 7.7.3 resolution: "semver@npm:7.7.3" @@ -8066,6 +8154,13 @@ __metadata: languageName: node linkType: hard +"tinypool@npm:2.1.0": + version: 2.1.0 + resolution: "tinypool@npm:2.1.0" + checksum: 10c0/9fb1c760558c6264e0f4cfde96a63b12450b43f1730fbe6274aa24ddbdf488745c08924d0dea7a1303b47d555416a6415f2113898c69b6ecf731e75ac95238a5 + languageName: node + linkType: hard + "tinyrainbow@npm:^2.0.0": version: 2.0.0 resolution: "tinyrainbow@npm:2.0.0"