From feb87dc79c25169afb842137e4245e70e5c85bc8 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Sun, 4 Jan 2026 22:01:29 -0700 Subject: [PATCH 1/4] formatter: Add a quick start guide I think the bunx command will work but I'm admittedly not totally sure. Regardless, this should work as a quick setup guide. --- .../usage/formatter/migrate-from-prettier.md | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/docs/guide/usage/formatter/migrate-from-prettier.md b/src/docs/guide/usage/formatter/migrate-from-prettier.md index 7b1b97c2326..235c35b198c 100644 --- a/src/docs/guide/usage/formatter/migrate-from-prettier.md +++ b/src/docs/guide/usage/formatter/migrate-from-prettier.md @@ -4,6 +4,30 @@ If you currently use Prettier as your code formatter, you can follow this guide Note that Oxfmt is in alpha, and may not be suitable for production use in complex setups. +## Quick Start + +For simpler setups, you can use these commands to immediately migrate to Oxfmt: + +::: code-group + +```bash [npm] +$ npm add -D oxfmt@latest && npx oxfmt --migrate=prettier && npx oxfmt +``` + +```bash [pnpm] +$ pnpm add -D oxfmt@latest && pnpm oxfmt --migrate=prettier && pnpm oxfmt +``` + +```bash [yarn] +$ yarn add -D oxfmt@latest && yarn oxfmt --migrate=prettier && yarn oxfmt +``` + +```bash [bun] +$ bun add -D oxfmt@latest && bunx oxfmt --migrate=prettier && bunx oxfmt +``` + +::: + ## Caveats for migrating to Oxfmt Before migrating, ensure that the current release of the Oxfmt alpha meets your project's needs. From e0cb2baa221ded9affd709c5cfc6c9e7412bb7e2 Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Sun, 4 Jan 2026 22:04:50 -0700 Subject: [PATCH 2/4] Simplify the migration doc a bit more. --- .../guide/usage/formatter/migrate-from-prettier.md | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/src/docs/guide/usage/formatter/migrate-from-prettier.md b/src/docs/guide/usage/formatter/migrate-from-prettier.md index 235c35b198c..5656aa65788 100644 --- a/src/docs/guide/usage/formatter/migrate-from-prettier.md +++ b/src/docs/guide/usage/formatter/migrate-from-prettier.md @@ -6,7 +6,7 @@ Note that Oxfmt is in alpha, and may not be suitable for production use in compl ## Quick Start -For simpler setups, you can use these commands to immediately migrate to Oxfmt: +For simpler setups, you can use these commands to immediately migrate to Oxfmt and format your codebase: ::: code-group @@ -37,7 +37,7 @@ It is almost entirely compatible with Prettier v3.7 already for basic configurat Other important considerations when migrating from Prettier to Oxfmt: - Oxfmt's formatting output is closest to Prettier v3.7. You will see more differences migrating from an older version of Prettier. -- Oxfmt uses a `printWidth` of 100 characters by default, whereas Prettier's default is 80. Make sure to set `"printWidth": 80` in `.oxfmtrc.jsonc` to minimize differences if you use the Prettier default. +- Oxfmt uses a `printWidth` of 100 characters by default, whereas Prettier's default is 80. You may want to set `printWidth` explicitly in your configuration file to match your previous setup. - Prettier plugins are not yet supported. - Some Prettier options are not supported. See the [oxfmt CLI documentation](/docs/guide/usage/formatter/config-file-reference.html) for the full list of currently-supported options. - Oxfmt supports an `--lsp` flag to spin up a Language Server Protocol server, but editor/IDE integration is still being developed and has not been tested/documented yet for most editors. @@ -93,15 +93,7 @@ A basic `.oxfmtrc.jsonc` file looks like this: } ``` -If you have a basic `.prettierrc` file, you can simply rename the file with `mv .prettierrc .oxfmtrc.jsonc`. - -If you are using something other than JSON to configure Prettier, you will need to convert the configuration to JSON. - -In either case, you can use the migrate command in your project root directory. - -```sh -oxfmt --migrate prettier -``` +If you have a basic `.prettierrc` file, you can simply use `oxfmt --migrate prettier` to convert it to `.oxfmtrc.jsonc`. This command automatically finds your configuration file and converts it to `.oxfmtrc.json` if possible. From 1eb99c9dcbce4b21bb08c69a7b395fb8e51f6b4f Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Sun, 4 Jan 2026 22:09:10 -0700 Subject: [PATCH 3/4] Rephrase. --- src/docs/guide/usage/formatter/migrate-from-prettier.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/guide/usage/formatter/migrate-from-prettier.md b/src/docs/guide/usage/formatter/migrate-from-prettier.md index 5656aa65788..d51632afd41 100644 --- a/src/docs/guide/usage/formatter/migrate-from-prettier.md +++ b/src/docs/guide/usage/formatter/migrate-from-prettier.md @@ -6,7 +6,7 @@ Note that Oxfmt is in alpha, and may not be suitable for production use in compl ## Quick Start -For simpler setups, you can use these commands to immediately migrate to Oxfmt and format your codebase: +For simpler setups, you can migrate to Oxfmt with a single line: ::: code-group From 1af16fab5cfc15d35fed48210f3a3bec9dff9b8b Mon Sep 17 00:00:00 2001 From: Connor Shea Date: Sun, 4 Jan 2026 22:09:25 -0700 Subject: [PATCH 4/4] Rephrase --- src/docs/guide/usage/formatter/migrate-from-prettier.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/docs/guide/usage/formatter/migrate-from-prettier.md b/src/docs/guide/usage/formatter/migrate-from-prettier.md index d51632afd41..b3499aebddc 100644 --- a/src/docs/guide/usage/formatter/migrate-from-prettier.md +++ b/src/docs/guide/usage/formatter/migrate-from-prettier.md @@ -6,7 +6,7 @@ Note that Oxfmt is in alpha, and may not be suitable for production use in compl ## Quick Start -For simpler setups, you can migrate to Oxfmt with a single line: +For simpler setups, you can migrate to Oxfmt with a single line in your terminal: ::: code-group