opencode
opencode copied to clipboard
Promote oxfmt formatter from experimental to first-class
Problem
Currently, oxfmt requires the OPENCODE_EXPERIMENTAL_OXFMT environment variable to be enabled before it can be used as a formatter. This is unnecessarily restrictive for projects that already use oxfmt.
If a project has:
- An
.oxfmtrc.jsonor.oxfmtrc.jsoncconfig file, or oxfmtin theirpackage.jsondependencies
...they've already made a deliberate choice to use oxfmt. Requiring an additional experimental flag adds friction without providing value.
Proposal
- Remove the experimental flag requirement from oxfmt detection
- Add config file detection (
.oxfmtrc.json,.oxfmtrc.jsonc) - similar to how biome is detected - Expand supported extensions to match oxfmt's full capabilities (JSON, CSS, HTML, YAML, Markdown, etc.)
- Keep the env var (marked as deprecated) for backward compatibility
References
- oxfmt docs
- oxfmt supported languages: JavaScript, JSX, TypeScript, TSX, JSON, JSONC, JSON5, YAML, TOML, HTML, Vue, CSS, SCSS, Less, Markdown, MDX, GraphQL
Implementation
PR: #8420