diff --git a/.github/contributing.md b/.github/contributing.md index 22ecf6e1189..8549c08b54f 100644 --- a/.github/contributing.md +++ b/.github/contributing.md @@ -59,7 +59,7 @@ Hi! I'm really excited that you are interested in contributing to Vue.js. Before - Commit messages must follow the [commit message convention](./commit-convention.md) so that changelogs can be automatically generated. Commit messages are automatically validated before commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)). -- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with Prettier on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)). +- No need to worry about code style as long as you have installed the dev dependencies - modified files are automatically formatted with oxfmt on commit (by invoking [Git Hooks](https://git-scm.com/docs/githooks) via [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks)). ### Advanced Pull Request Tips @@ -92,15 +92,15 @@ A high level overview of tools used: - [Vite](https://vitejs.dev/) and [ESBuild](https://esbuild.github.io/) for development bundling - [Rollup](https://rollupjs.org) for production bundling - [Vitest](https://vitest.dev/) for unit testing -- [Prettier](https://prettier.io/) for code formatting - [oxlint](https://oxc.rs/docs/guide/usage/linter.html) for static error prevention (outside of types) +- [oxfmt](https://oxc.rs/docs/guide/usage/formatter.html) for code formatting ## Git Hooks The project uses [simple-git-hooks](https://github.com/toplenboren/simple-git-hooks) to enforce the following on each commit: - Type check the entire project -- Automatically format changed files using Prettier +- Automatically format changed files using oxfmt - Verify commit message format (logic in `scripts/verify-commit.js`) ## Scripts diff --git a/.github/renovate.json5 b/.github/renovate.json5 index 88bc85a8a4c..5aebe95d89f 100644 --- a/.github/renovate.json5 +++ b/.github/renovate.json5 @@ -41,7 +41,7 @@ 'simple-git-hooks', 'lint-staged', 'oxlint', - 'prettier{/,}**', + 'oxfmt{/,}**', ], }, ], diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index bb98ffb059f..6f5fd0caef7 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -28,7 +28,7 @@ jobs: - name: Run oxlint run: pnpm run lint --fix - - name: Run prettier + - name: Run oxfmt run: pnpm run format - uses: autofix-ci/action@635ffb0c9798bd160680f18fd73371e355b85f27 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5df4962c59e..1becc320d1f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -127,7 +127,7 @@ jobs: - name: Run oxlint run: pnpm run lint - - name: Run prettier + - name: Run oxfmt run: pnpm run format-check - name: Run tsc diff --git a/.oxfmtrc.jsonc b/.oxfmtrc.jsonc new file mode 100644 index 00000000000..d3948f56ca4 --- /dev/null +++ b/.oxfmtrc.jsonc @@ -0,0 +1,9 @@ +{ + "$schema": "./node_modules/oxfmt/configuration_schema.json", + "semi": false, + "singleQuote": true, + "arrowParens": "avoid", + "printWidth": 80, + "experimentalSortPackageJson": false, + "ignorePatterns": ["dist", "CHANGELOG*.md", "*.toml"], +} diff --git a/.prettierignore b/.prettierignore deleted file mode 100644 index ca3c40849fd..00000000000 --- a/.prettierignore +++ /dev/null @@ -1,3 +0,0 @@ -dist -pnpm-lock.yaml -CHANGELOG*.md diff --git a/.prettierrc b/.prettierrc deleted file mode 100644 index 759232e7cf6..00000000000 --- a/.prettierrc +++ /dev/null @@ -1,5 +0,0 @@ -{ - "semi": false, - "singleQuote": true, - "arrowParens": "avoid" -} diff --git a/.vscode/settings.json b/.vscode/settings.json index 0774291face..9006396c86a 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,16 +9,17 @@ "yml": true }, - // Use prettier to format TypeScript, JavaScript and JSON files + // Use Oxc to format TypeScript, JavaScript and JSON files "[typescript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "oxc.oxc-vscode" }, "[javascript]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" - }, - "[json]": { - "editor.defaultFormatter": "esbenp.prettier-vscode" + "editor.defaultFormatter": "oxc.oxc-vscode" }, + // oxc-vscode does not yet support JSON formatting + // "[json]": { + // "editor.defaultFormatter": "oxc.oxc-vscode" + // }, "editor.formatOnSave": true, "vitest.disableWorkspaceWarning": true } diff --git a/package.json b/package.json index f1ed63c0e61..7d55f15282c 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,8 @@ "size-esm": "node scripts/build.js runtime-shared runtime-dom runtime-core reactivity shared runtime-vapor -f esm-bundler", "check": "tsc --incremental --noEmit", "lint": "oxlint", - "format": "prettier --write --cache .", - "format-check": "prettier --check --cache .", + "format": "oxfmt", + "format-check": "oxfmt --check", "test": "vitest", "test-unit": "vitest --project unit*", "test-e2e": "node scripts/build.js vue -f global+esm-browser-vapor -d && vitest --project e2e", @@ -51,15 +51,15 @@ }, "lint-staged": { "*.{js,json}": [ - "prettier --write" + "oxfmt --no-error-on-unmatched-pattern" ], "*.ts?(x)": [ "oxlint --fix", - "prettier --parser=typescript --write" + "oxfmt --no-error-on-unmatched-pattern" ] }, "engines": { - "node": ">=18.12.0" + "node": ">=22.12.0" }, "devDependencies": { "@babel/parser": "catalog:", @@ -90,8 +90,8 @@ "marked": "13.0.3", "oxlint": "^1.24.0", "npm-run-all2": "^8.0.4", + "oxfmt": "^0.20.0", "picocolors": "^1.1.1", - "prettier": "^3.7.4", "pretty-bytes": "^7.1.0", "pug": "^3.0.3", "puppeteer": "~24.33.0", diff --git a/packages/vue/examples/transition/modal.html b/packages/vue/examples/transition/modal.html index 96a16cfdabe..741149ae1c1 100644 --- a/packages/vue/examples/transition/modal.html +++ b/packages/vue/examples/transition/modal.html @@ -107,13 +107,13 @@

custom header

} /* - * The following styles are auto-applied to elements with - * transition="modal" when their visibility is toggled - * by Vue.js. - * - * You can easily play with the modal transition by editing - * these styles. - */ + * The following styles are auto-applied to elements with + * transition="modal" when their visibility is toggled + * by Vue.js. + * + * You can easily play with the modal transition by editing + * these styles. + */ .modal-enter-from { opacity: 0; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 6bd8593b50a..7605b2c34e1 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -113,15 +113,15 @@ importers: npm-run-all2: specifier: ^8.0.4 version: 8.0.4 + oxfmt: + specifier: ^0.20.0 + version: 0.20.0 oxlint: specifier: ^1.24.0 version: 1.24.0 picocolors: specifier: ^1.1.1 version: 1.1.1 - prettier: - specifier: ^3.7.4 - version: 3.7.4 pretty-bytes: specifier: ^7.1.0 version: 7.1.0 @@ -1112,6 +1112,50 @@ packages: '@jspm/core@2.1.0': resolution: {integrity: sha512-3sRl+pkyFY/kLmHl0cgHiFp2xEqErA8N3ECjMs7serSUBmoJ70lBa0PG5t0IM6WJgdZNyyI0R8YFfi5wM8+mzg==} + '@oxfmt/darwin-arm64@0.20.0': + resolution: {integrity: sha512-bjR5dqvrd9gxKYfYR0ljUu3/T3+TuDVWcwA7d+tsfmx9lqidlw3zhgBTblnjF1mrd1zkPMoc5zzq86GeSEt1cA==} + cpu: [arm64] + os: [darwin] + + '@oxfmt/darwin-x64@0.20.0': + resolution: {integrity: sha512-esUDes8FlJX3IY4TVjFLgZrnZlIIyPDlhkCaHgGR3+z2eHFZOvQu68kTSpZLCEJmGXdSpU5rlveycQ6n8tk9ew==} + cpu: [x64] + os: [darwin] + + '@oxfmt/linux-arm64-gnu@0.20.0': + resolution: {integrity: sha512-irE0RO9B0R6ziQE6kUVZtZ6IuTdRyuumn1cPWhDfpa0XUa5sE0ly8pjVsvJbj/J9qerVtidU05txeXBB5CirQg==} + cpu: [arm64] + os: [linux] + libc: [glibc] + + '@oxfmt/linux-arm64-musl@0.20.0': + resolution: {integrity: sha512-eXPBLwYJm26DCmwMwhelEwQMRwuGNaYhYZOhd+CYYsmVoF+h6L6dtjwj0Ovuu0Gqh18EL8vfsaoUvb+jr3vEBg==} + cpu: [arm64] + os: [linux] + libc: [musl] + + '@oxfmt/linux-x64-gnu@0.20.0': + resolution: {integrity: sha512-dTPW38Hjgb7LoD2mNgyQGBaJ1hu5YgPrxImhl5Eb04eiws+ETCM0wrb2TWGduA+Nv3rHKn3vZEkMTEjklZXgRw==} + cpu: [x64] + os: [linux] + libc: [glibc] + + '@oxfmt/linux-x64-musl@0.20.0': + resolution: {integrity: sha512-b4duw9JGDK/kZoqrPNU9tBOOZQdUW8KJPZ7gW7z54X1eGSqCJ1PT0XLNmZ7SOA1BzQwQ0a3qmQWfFVOsH3a5bw==} + cpu: [x64] + os: [linux] + libc: [musl] + + '@oxfmt/win32-arm64@0.20.0': + resolution: {integrity: sha512-XAzvBhw4K+Fe16dBaFgYAdob9WaM8RYEXl0ibbm5NlNaQEq+5bH9xwc0oaYlHFnLfcgXWmn9ceTAYqNlONQRNA==} + cpu: [arm64] + os: [win32] + + '@oxfmt/win32-x64@0.20.0': + resolution: {integrity: sha512-fkJqHbJaoOMRmrjHSljyb4/7BgXO3xPLBsJSFGtm3mpfW0HHFbAKvd4/6njhqJz9KY+b3RWP1WssjFshcqQQ4w==} + cpu: [x64] + os: [win32] + '@oxlint/darwin-arm64@1.24.0': resolution: {integrity: sha512-1Kd2+Ai1ttskhbJR+DNU4Y4YEDyP/cd50nWt2rAe2aE78dMOalaVGps3s8UnJkXpDL9ZqkgOHVDE5Doj2lxatw==} cpu: [arm64] @@ -2819,6 +2863,11 @@ packages: resolution: {integrity: sha512-YgBpdJHPyQ2UE5x+hlSXcnejzAvD0b22U2OuAP+8OnlJT+PjWPxtgmGqKKc+RgTM63U9gN0YzrYc71R2WT/hTA==} engines: {node: '>=18'} + oxfmt@0.20.0: + resolution: {integrity: sha512-+7f8eV8iaK3tENN/FUVxZM1g78HjPehybN8/+/dvEA1O893Dcvk6O7/Q1wTQOHMD7wvdwWdujKl+Uo8QMiKDrQ==} + engines: {node: ^20.19.0 || >=22.12.0} + hasBin: true + oxlint@1.24.0: resolution: {integrity: sha512-swXlnHT7ywcCApkctIbgOSjDYHwMa12yMU0iXevfDuHlYkRUcbQrUv6nhM5v6B0+Be3zTBMNDGPAMQv0oznzRQ==} engines: {node: ^20.19.0 || >=22.12.0} @@ -2955,11 +3004,6 @@ packages: resolution: {integrity: sha512-3Ybi1tAuwAP9s0r1UQ2J4n5Y0G05bJkpUIO0/bI9MhwmD70S5aTWbXGBwxHrelT+XM1k6dM0pk+SwNkpTRN7Pg==} engines: {node: ^10 || ^12 || >=14} - prettier@3.7.4: - resolution: {integrity: sha512-v6UNi1+3hSlVvv8fSaoUbggEM5VErKmmpGA7Pl3HF8V6uKY7rvClBOJlH6yNwQtfTueNkGVpOv/mtWL9L4bgRA==} - engines: {node: '>=14'} - hasBin: true - pretty-bytes@7.1.0: resolution: {integrity: sha512-nODzvTiYVRGRqAOvE84Vk5JDPyyxsVk0/fbA/bq7RqlnhksGpset09XTxbpvLTIjoaF7K8Z8DG8yHtKGTPSYRw==} engines: {node: '>=20'} @@ -3335,6 +3379,10 @@ packages: resolution: {integrity: sha512-Zba82s87IFq9A9XmjiX5uZA/ARWDrB03OHlq+Vw1fSdt0I+4/Kutwy8BP4Y/y/aORMo61FQ0vIb5j44vSo5Pkg==} engines: {node: ^18.0.0 || >=20.0.0} + tinypool@2.0.0: + resolution: {integrity: sha512-/RX9RzeH2xU5ADE7n2Ykvmi9ED3FBGPAjw9u3zucrNNaEBIO0HPSYgL0NT7+3p147ojeSdaVu08F6hjpv31HJg==} + engines: {node: ^20.0.0 || >=22.0.0} + tinyrainbow@2.0.0: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} @@ -4034,6 +4082,30 @@ snapshots: '@jspm/core@2.1.0': {} + '@oxfmt/darwin-arm64@0.20.0': + optional: true + + '@oxfmt/darwin-x64@0.20.0': + optional: true + + '@oxfmt/linux-arm64-gnu@0.20.0': + optional: true + + '@oxfmt/linux-arm64-musl@0.20.0': + optional: true + + '@oxfmt/linux-x64-gnu@0.20.0': + optional: true + + '@oxfmt/linux-x64-musl@0.20.0': + optional: true + + '@oxfmt/win32-arm64@0.20.0': + optional: true + + '@oxfmt/win32-x64@0.20.0': + optional: true + '@oxlint/darwin-arm64@1.24.0': optional: true @@ -5719,6 +5791,19 @@ snapshots: is-inside-container: 1.0.0 wsl-utils: 0.1.0 + oxfmt@0.20.0: + dependencies: + tinypool: 2.0.0 + optionalDependencies: + '@oxfmt/darwin-arm64': 0.20.0 + '@oxfmt/darwin-x64': 0.20.0 + '@oxfmt/linux-arm64-gnu': 0.20.0 + '@oxfmt/linux-arm64-musl': 0.20.0 + '@oxfmt/linux-x64-gnu': 0.20.0 + '@oxfmt/linux-x64-musl': 0.20.0 + '@oxfmt/win32-arm64': 0.20.0 + '@oxfmt/win32-x64': 0.20.0 + oxlint@1.24.0: optionalDependencies: '@oxlint/darwin-arm64': 1.24.0 @@ -5857,8 +5942,6 @@ snapshots: picocolors: 1.1.1 source-map-js: 1.2.1 - prettier@3.7.4: {} - pretty-bytes@7.1.0: {} process-nextick-args@2.0.1: {} @@ -6355,6 +6438,8 @@ snapshots: tinypool@1.1.1: {} + tinypool@2.0.0: {} + tinyrainbow@2.0.0: {} tinyspy@4.0.4: {}