From a6774d6652fa436c85fd1f07c6770996c4deff8f Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Thu, 31 Jul 2025 01:00:01 -0400 Subject: [PATCH] sync --- packages/opencode/src/format/formatter.ts | 41 +++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/packages/opencode/src/format/formatter.ts b/packages/opencode/src/format/formatter.ts index a76019834..8cb77df2b 100644 --- a/packages/opencode/src/format/formatter.ts +++ b/packages/opencode/src/format/formatter.ts @@ -74,6 +74,47 @@ export const prettier: Info = { }, } +export const biome: Info = { + name: "biome", + command: [BunProc.which(), "x", "biome", "format", "--write", "$FILE"], + environment: { + BUN_BE_BUN: "1", + }, + extensions: [ + ".js", + ".jsx", + ".mjs", + ".cjs", + ".ts", + ".tsx", + ".mts", + ".cts", + ".html", + ".htm", + ".css", + ".scss", + ".sass", + ".less", + ".vue", + ".svelte", + ".json", + ".jsonc", + ".yaml", + ".yml", + ".toml", + ".xml", + ".md", + ".mdx", + ".graphql", + ".gql", + ], + async enabled() { + const app = App.info() + const items = await Filesystem.findUp("biome.json", app.path.cwd, app.path.root) + return items.length > 0 + }, +} + export const zig: Info = { name: "zig", command: ["zig", "fmt", "$FILE"],