---
title: How to fix Prettier and Oxfmt conflicts in VS Code and Zed
url: https://roboin.io/article/en/2026/10/25/how-to-fix-prettier-and-oxfmt-conflicts/
description: "When I tried to use Oxfmt as my formatter in editors like Zed and
  VS Code, I ran into a problem: I couldn't use it alongside Prettier. After
  exploring possible workarounds, I concluded that using Bun as the formatter
  seems to be the best approach. Here's how to set it up."
publishedDate: 2026-10-24T17:37:48.822Z
modifiedDate: 2026-10-24T17:37:48.822Z
thumbnail: https://roboin.io/api/og/en/2026/10/25/how-to-fix-prettier-and-oxfmt-conflicts/
thumbnailAlt: 記事のサムネイル画像
thumbnailCaption: N/A
---

# How to fix Prettier and Oxfmt conflicts in VS Code and Zed

When I tried to use Oxfmt as my formatter in editors like Zed and VS Code, I ran into a problem: I couldn't use it alongside Prettier. After exploring possible workarounds, I concluded that using Bun as the formatter seems to be the best approach. Here's how to set it up.

## The problem

Zed comes with Prettier built in and uses it as the default formatter. To use Oxfmt instead, you need to add the following configuration:

```json
{
    "formatter": {
        "language_server": {
            "name": "oxfmt"
        }
    }
}
```

However, with this setting, Zed stops using Prettier. In projects that use Prettier, Zed ignores `.prettierrc.json` and formats files using Oxfmt's default settings. Without this setting, Zed ignores `.oxfmtrc.json` in projects that use Oxfmt and formats files using Prettier's default settings.

This isn't a problem if you only work on projects that use one formatter. However, if you regularly switch between projects that use Prettier and those that use Oxfmt, you can't use both formatters with the same editor configuration.

Zed does let you override global settings through a project's `.zed/settings.json` file. You could keep Prettier as the global formatter, since it's more widely used, and configure Oxfmt at the project level wherever you need it.

That approach works for projects you maintain yourself, but you can't just add Zed-specific configuration files to projects maintained by others.

I've only tested this in Zed, but I suspect VS Code has a similar problem.

## The solution

After discussing this problem with ChatGPT, I concluded that using Bun as the formatter seems to be a good solution.

In [v1.4.4](https://bun.com/blog/bun-v1.4.4), Bun introduced the `bun fmt` command, which offers compatibility with both Prettier and Oxfmt. In projects with a `.prettierrc.json` file, `bun fmt` behaves like a Prettier-compatible formatter. In projects with a `.oxfmtrc.json` file, it behaves like an Oxfmt-compatible formatter.

This means you can use `bun fmt` to format files according to each project's configuration, regardless of whether the project uses Prettier or Oxfmt.

Although `bun fmt` aims to be compatible with both Prettier and Oxfmt, it doesn't use either formatter internally. As a result, some edge cases may produce different formatting results. I expect such cases to be rare, though, and most projects likely check formatting in CI, so I don't consider this a major concern.

In Zed, install Bun v1.4.4 or later on your system and add the following configuration to use Bun as the formatter:

```json
{
    "formatter": {
        "external": {
            "command": "bun",
            "arguments": ["fmt", "--no-script", "--stdin-filepath", "{buffer_path}"]
        }
    }
}
```

For VS Code, install an extension such as [Simple LSP Client](https://marketplace.visualstudio.com/items?itemName=wdomitrz.simple-lsp-client&utm_source=chatgpt.com) and register Bun as a language server for formatting. VS Code's Simple LSP Client doesn't seem to load PowerShell profiles, so if you manage Bun with mise or a similar tool, you'll need to specify the absolute path to the Bun binary.

```json
{
    "simpleLspClient.formatters": {
        "bun": {
            "cmd": [
                "bun",
                "fmt",
                "--no-script",
                "--stdin-filepath",
                "${file}"
            ],
            "filetypes": [
                "javascript",
                "javascriptreact",
                "typescript",
                "typescriptreact",
                "json",
                "jsonc",
                "css",
                "scss",
                "less",
                "html",
                "markdown",
                "yaml"
            ]
        }
    },
    "[javascript][javascriptreact][typescript][typescriptreact][json][jsonc][css][scss][less][html][markdown][yaml]": {
        "editor.defaultFormatter": "wdomitrz.simple-lsp-client",
        "editor.formatOnSave": true
    }
}
```

## Conclusion

I've covered how to work around the conflict between Prettier and Oxfmt in editors like Zed and VS Code.

With the default editor configuration, you can't use Prettier and Oxfmt together across projects. By configuring `bun fmt` as your formatter, you can effectively work with both without changing your editor settings for each project.