@@ -11,25 +11,26 @@ OpenCode automatically formats files after they are written or edited using lang
1111
1212OpenCode 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.
1313
14- | Formatter | Extensions | Requirements |
15- | -------------- | -------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------- |
16- | gofmt | .go | ` gofmt ` command available |
17- | mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | ` mix ` command available |
18- | prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [ more] ( https://prettier.io/docs/en/index.html ) | ` prettier ` dependency in ` package.json ` |
19- | biome | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [ more] ( https://biomejs.dev/ ) | ` biome.json(c) ` config file |
20- | zig | .zig, .zon | ` zig ` command available |
21- | clang-format | .c, .cpp, .h, .hpp, .ino, and [ more] ( https://clang.llvm.org/docs/ClangFormat.html ) | ` .clang-format ` config file |
22- | ktlint | .kt, .kts | ` ktlint ` command available |
23- | ruff | .py, .pyi | ` ruff ` command available with config |
24- | uv | .py, .pyi | ` uv ` command available |
25- | rubocop | .rb, .rake, .gemspec, .ru | ` rubocop ` command available |
26- | standardrb | .rb, .rake, .gemspec, .ru | ` standardrb ` command available |
27- | htmlbeautifier | .erb, .html.erb | ` htmlbeautifier ` command available |
28- | air | .R | ` air ` command available |
29- | dart | .dart | ` dart ` command available |
30- | ocamlformat | .ml, .mli | ` ocamlformat ` command available and ` .ocamlformat ` config file |
31- | terraform | .tf, .tfvars | ` terraform ` command available |
32- | gleam | .gleam | ` gleam ` command available |
14+ | Formatter | Extensions | Requirements |
15+ | -------------------- | -------------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------- |
16+ | gofmt | .go | ` gofmt ` command available |
17+ | mix | .ex, .exs, .eex, .heex, .leex, .neex, .sface | ` mix ` command available |
18+ | prettier | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [ more] ( https://prettier.io/docs/en/index.html ) | ` prettier ` dependency in ` package.json ` |
19+ | biome | .js, .jsx, .ts, .tsx, .html, .css, .md, .json, .yaml, and [ more] ( https://biomejs.dev/ ) | ` biome.json(c) ` config file |
20+ | zig | .zig, .zon | ` zig ` command available |
21+ | clang-format | .c, .cpp, .h, .hpp, .ino, and [ more] ( https://clang.llvm.org/docs/ClangFormat.html ) | ` .clang-format ` config file |
22+ | ktlint | .kt, .kts | ` ktlint ` command available |
23+ | ruff | .py, .pyi | ` ruff ` command available with config |
24+ | uv | .py, .pyi | ` uv ` command available |
25+ | rubocop | .rb, .rake, .gemspec, .ru | ` rubocop ` command available |
26+ | standardrb | .rb, .rake, .gemspec, .ru | ` standardrb ` command available |
27+ | htmlbeautifier | .erb, .html.erb | ` htmlbeautifier ` command available |
28+ | air | .R | ` air ` command available |
29+ | dart | .dart | ` dart ` command available |
30+ | ocamlformat | .ml, .mli | ` ocamlformat ` command available and ` .ocamlformat ` config file |
31+ | terraform | .tf, .tfvars | ` terraform ` command available |
32+ | gleam | .gleam | ` gleam ` command available |
33+ | oxfmt (Experimental) | .js, .jsx, .ts, .tsx | ` oxfmt ` dependency in ` package.json ` and an [ experiental env variable flag] ( /docs/cli/#experimental ) |
3334
3435So if your project has ` prettier ` in your ` package.json ` , OpenCode will automatically use it.
3536
0 commit comments