[PR #8420] feat(format): promote oxfmt to first-class formatter #12736

Closed
opened 2026-02-16 18:17:38 -05:00 by yindo · 0 comments
Owner

Original Pull Request: https://github.com/anomalyco/opencode/pull/8420

State: closed
Merged: No


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

**Original Pull Request:** https://github.com/anomalyco/opencode/pull/8420 **State:** closed **Merged:** No --- ## 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 - [oxfmt docs](https://oxc.rs/docs/guide/usage/formatter.html) - [oxfmt config reference](https://oxc.rs/docs/guide/usage/formatter/config)
yindo added the pull-request label 2026-02-16 18:17:38 -05:00
yindo closed this issue 2026-02-16 18:17:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#12736