summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJake <[email protected]>2025-08-11 13:48:46 +0200
committerGitHub <[email protected]>2025-08-11 06:48:46 -0500
commit6c30565d40023d001f072d76a80ed3b14149499c (patch)
tree443e7298847560f208f27147e72fad8d73a90459
parentb223a29603f489063acced737b3004c32c1cf606 (diff)
downloadopencode-6c30565d40023d001f072d76a80ed3b14149499c.tar.gz
opencode-6c30565d40023d001f072d76a80ed3b14149499c.zip
Add support for biome.jsonc config file (#1791)
-rw-r--r--packages/opencode/src/format/formatter.ts12
-rw-r--r--packages/web/src/content/docs/docs/formatters.mdx2
2 files changed, 10 insertions, 4 deletions
diff --git a/packages/opencode/src/format/formatter.ts b/packages/opencode/src/format/formatter.ts
index 8a8bbc9aa..0869ef505 100644
--- a/packages/opencode/src/format/formatter.ts
+++ b/packages/opencode/src/format/formatter.ts
@@ -76,7 +76,7 @@ export const prettier: Info = {
export const biome: Info = {
name: "biome",
- command: [BunProc.which(), "x", "biome", "format", "--write", "$FILE"],
+ command: [BunProc.which(), "x", "@biomejs/biome", "format", "--write", "$FILE"],
environment: {
BUN_BE_BUN: "1",
},
@@ -110,8 +110,14 @@ export const biome: Info = {
],
async enabled() {
const app = App.info()
- const items = await Filesystem.findUp("biome.json", app.path.cwd, app.path.root)
- return items.length > 0
+ const configs = ["biome.json", "biome.jsonc"]
+ for (const config of configs) {
+ const found = await Filesystem.findUp(config, app.path.cwd, app.path.root)
+ if (found.length > 0) {
+ return true
+ }
+ }
+ return false
},
}
diff --git a/packages/web/src/content/docs/docs/formatters.mdx b/packages/web/src/content/docs/docs/formatters.mdx
index 720f3c1af..9c9411aeb 100644
--- a/packages/web/src/content/docs/docs/formatters.mdx
+++ b/packages/web/src/content/docs/docs/formatters.mdx
@@ -16,7 +16,7 @@ opencode comes with several built-in formatters for popular languages and framew
| 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` config file |
+| 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 |