opencode
opencode copied to clipboard
feat(format): promote oxfmt to first-class formatter
Summary
Promotes oxfmt from experimental to first-class formatter status with improved detection and full extension support.
Changes
-
Remove experimental flag requirement - No longer requires
OPENCODE_EXPERIMENTAL_OXFMTenv var -
Add config file detection - Detects
.oxfmtrc.jsonand.oxfmtrc.jsonc(similar to biome pattern) - Expand supported extensions - From 8 to 22 extensions matching oxfmt's capabilities
-
Mark flag as deprecated - Added
@deprecatedJSDoc comment toOPENCODE_EXPERIMENTAL_OXFMTflag for backward compatibility
Supported Extensions
| Category | Extensions |
|---|---|
| JS/TS | .js, .jsx, .mjs, .cjs, .ts, .tsx, .mts, .cts |
| JSON | .json, .jsonc |
| Markup | .html, .vue |
| Styles | .css, .scss, .less |
| Data | .yaml, .yml, .toml |
| Docs | .md, .mdx |
| GraphQL | .graphql, .gql |
Detection Priority
- Config files (
.oxfmtrc.json,.oxfmtrc.jsonc) -
package.jsondependencies (oxfmtin deps or devDeps)
Why keep the env var?
The OPENCODE_EXPERIMENTAL_OXFMT flag is kept (but marked as @deprecated) for backward compatibility. Users who already have this flag set in their environment won't experience any breaking changes - the flag simply becomes a no-op.