summaryrefslogtreecommitdiffhomepage
path: root/packages/web
diff options
context:
space:
mode:
authormatvey <[email protected]>2025-12-16 23:43:14 +0300
committerGitHub <[email protected]>2025-12-16 14:43:14 -0600
commit1aee8b49e1d7158533652fc611fdb811b2ff59fb (patch)
treedbd3d6067532c3baf9b90867bac17731d5e212a6 /packages/web
parent984f17ddd7c420a19f98dae2cd3e8b2173ec52e2 (diff)
downloadopencode-1aee8b49e1d7158533652fc611fdb811b2ff59fb.tar.gz
opencode-1aee8b49e1d7158533652fc611fdb811b2ff59fb.zip
feat: add experimental oxfmt formatter (#5620)
Diffstat (limited to 'packages/web')
-rw-r--r--packages/web/src/content/docs/cli.mdx1
-rw-r--r--packages/web/src/content/docs/formatters.mdx39
2 files changed, 21 insertions, 19 deletions
diff --git a/packages/web/src/content/docs/cli.mdx b/packages/web/src/content/docs/cli.mdx
index 6fd7307b2..393046c97 100644
--- a/packages/web/src/content/docs/cli.mdx
+++ b/packages/web/src/content/docs/cli.mdx
@@ -326,3 +326,4 @@ These environment variables enable experimental features that may change or be r
| `OPENCODE_EXPERIMENTAL_BASH_MAX_OUTPUT_LENGTH` | number | Max output length for bash commands |
| `OPENCODE_EXPERIMENTAL_BASH_DEFAULT_TIMEOUT_MS` | number | Default timeout for bash commands in ms |
| `OPENCODE_EXPERIMENTAL_FILEWATCHER` | boolean | Enable file watcher for entire dir |
+| `OPENCODE_EXPERIMENTAL_OXFMT` | boolean | Enable oxfmt formatter |
diff --git a/packages/web/src/content/docs/formatters.mdx b/packages/web/src/content/docs/formatters.mdx
index 052138f68..c2c01836b 100644
--- a/packages/web/src/content/docs/formatters.mdx
+++ b/packages/web/src/content/docs/formatters.mdx
@@ -11,25 +11,26 @@ OpenCode automatically formats files after they are written or edited using lang
OpenCode comes with several built-in formatters for popular languages and frameworks. Below is a list of the formatters, supported file extensions, and commands or config options it needs.
-| Formatter | Extensions | Requirements |
-| -------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
-| gofmt | .go | `gofmt` command available |
-| mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | `mix` command available |
-| prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://prettier.io/docs/en/index.html) | `prettier` dependency in `package.json` |
-| biome | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://biomejs.dev/) | `biome.json(c)` config file |
-| zig | .zig, .zon | `zig` command available |
-| clang-format | .c, .cpp, .h, .hpp, .ino, and [more](https://clang.llvm.org/docs/ClangFormat.html) | `.clang-format` config file |
-| ktlint | .kt, .kts | `ktlint` command available |
-| ruff | .py, .pyi | `ruff` command available with config |
-| uv | .py, .pyi | `uv` command available |
-| rubocop | .rb, .rake, .gemspec, .ru | `rubocop` command available |
-| standardrb | .rb, .rake, .gemspec, .ru | `standardrb` command available |
-| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available |
-| air | .R | `air` command available |
-| dart | .dart | `dart` command available |
-| ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file |
-| terraform | .tf, .tfvars | `terraform` command available |
-| gleam | .gleam | `gleam` command available |
+| Formatter | Extensions | Requirements |
+| -------------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
+| gofmt | .go | `gofmt` command available |
+| mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | `mix` command available |
+| prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://prettier.io/docs/en/index.html) | `prettier` dependency in `package.json` |
+| biome | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [more](https://biomejs.dev/) | `biome.json(c)` config file |
+| zig | .zig, .zon | `zig` command available |
+| clang-format | .c, .cpp, .h, .hpp, .ino, and [more](https://clang.llvm.org/docs/ClangFormat.html) | `.clang-format` config file |
+| ktlint | .kt, .kts | `ktlint` command available |
+| ruff | .py, .pyi | `ruff` command available with config |
+| uv | .py, .pyi | `uv` command available |
+| rubocop | .rb, .rake, .gemspec, .ru | `rubocop` command available |
+| standardrb | .rb, .rake, .gemspec, .ru | `standardrb` command available |
+| htmlbeautifier | .erb, .html.erb | `htmlbeautifier` command available |
+| air | .R | `air` command available |
+| dart | .dart | `dart` command available |
+| ocamlformat | .ml, .mli | `ocamlformat` command available and `.ocamlformat` config file |
+| terraform | .tf, .tfvars | `terraform` command available |
+| gleam | .gleam | `gleam` command available |
+| oxfmt (Experimental) | .js, .jsx, .ts, .tsx | `oxfmt` dependency in `package.json` and an [experiental env variable flag](/docs/cli/#experimental) |
So if your project has `prettier` in your `package.json`, OpenCode will automatically use it.