opencode icon indicating copy to clipboard operation
opencode copied to clipboard

feat(format): promote oxfmt to first-class formatter

Open kynnyhsap opened this issue 1 day ago • 2 comments

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_OXFMT env var
  • Add config file detection - Detects .oxfmtrc.json and .oxfmtrc.jsonc (similar to biome pattern)
  • Expand supported extensions - From 8 to 22 extensions matching oxfmt's capabilities
  • Mark flag as deprecated - Added @deprecated JSDoc comment to OPENCODE_EXPERIMENTAL_OXFMT flag 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

  1. Config files (.oxfmtrc.json, .oxfmtrc.jsonc)
  2. package.json dependencies (oxfmt in 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.

References

kynnyhsap avatar Jan 14 '26 10:01 kynnyhsap