mirror of
https://github.com/aljazceru/opencode.git
synced 2026-01-08 02:14:53 +01:00
docs: make formatter docs a bit more clear (#1613)
This commit is contained in:
@@ -86,16 +86,20 @@ To disable a specific formatter, set `disabled` to `true`:
|
|||||||
|
|
||||||
You can override the built-in formatters or add new ones by specifying the command, environment variables, and file extensions:
|
You can override the built-in formatters or add new ones by specifying the command, environment variables, and file extensions:
|
||||||
|
|
||||||
```json title="opencode.json" {4-10}
|
```json title="opencode.json" {4-14}
|
||||||
{
|
{
|
||||||
"$schema": "https://opencode.ai/config.json",
|
"$schema": "https://opencode.ai/config.json",
|
||||||
"formatter": {
|
"formatter": {
|
||||||
"custom-prettier": {
|
"prettier": {
|
||||||
"command": ["npx", "prettier", "--write", "$FILE"],
|
"command": ["npx", "prettier", "--write", "$FILE"],
|
||||||
"environment": {
|
"environment": {
|
||||||
"NODE_ENV": "development"
|
"NODE_ENV": "development"
|
||||||
},
|
},
|
||||||
"extensions": [".js", ".ts", ".jsx", ".tsx"]
|
"extensions": [".js", ".ts", ".jsx", ".tsx"]
|
||||||
|
},
|
||||||
|
"custom-markdown-formatter": {
|
||||||
|
"command": ["deno", "fmt", "$FILE"],
|
||||||
|
"extensions": [".md"]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user