mirror of
https://github.com/aljazceru/opencode.git
synced 2025-12-23 18:54:21 +01:00
Add support for biome.jsonc config file (#1791)
This commit is contained in:
@@ -76,7 +76,7 @@ export const prettier: Info = {
|
|||||||
|
|
||||||
export const biome: Info = {
|
export const biome: Info = {
|
||||||
name: "biome",
|
name: "biome",
|
||||||
command: [BunProc.which(), "x", "biome", "format", "--write", "$FILE"],
|
command: [BunProc.which(), "x", "@biomejs/biome", "format", "--write", "$FILE"],
|
||||||
environment: {
|
environment: {
|
||||||
BUN_BE_BUN: "1",
|
BUN_BE_BUN: "1",
|
||||||
},
|
},
|
||||||
@@ -110,8 +110,14 @@ export const biome: Info = {
|
|||||||
],
|
],
|
||||||
async enabled() {
|
async enabled() {
|
||||||
const app = App.info()
|
const app = App.info()
|
||||||
const items = await Filesystem.findUp("biome.json", app.path.cwd, app.path.root)
|
const configs = ["biome.json", "biome.jsonc"]
|
||||||
return items.length > 0
|
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
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ opencode comes with several built-in formatters for popular languages and framew
|
|||||||
| gofmt | .go | `gofmt` command available |
|
| gofmt | .go | `gofmt` command available |
|
||||||
| mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | `mix` 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` |
|
| 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 |
|
| 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 |
|
| 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 |
|
| ktlint | .kt, .kts | `ktlint` command available |
|
||||||
|
|||||||
Reference in New Issue
Block a user