Skip to content

Add oxfmt/oxlint support alongside prettier/eslint#202

Merged
rikuson merged 1 commit into
masterfrom
worktree-luminous-churning-kettle
Apr 24, 2026
Merged

Add oxfmt/oxlint support alongside prettier/eslint#202
rikuson merged 1 commit into
masterfrom
worktree-luminous-churning-kettle

Conversation

@rikuson

@rikuson rikuson commented Apr 24, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add oxfmt as a formatter option for JS/TS filetypes in conform.nvim, with fallback to prettier via stop_after_first
  • Add oxc language server (oxlint) to mason-lspconfig's ensure_installed list

Test plan

  • Open a JS/TS project with oxfmt installed and verify it formats on save
  • Open a JS/TS project without oxfmt and verify prettier is used as fallback
  • Verify oxlint diagnostics appear via oxc language server
  • Verify eslint still works alongside oxlint

🤖 Generated with Claude Code

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@claude

claude Bot commented Apr 24, 2026

Copy link
Copy Markdown

Code Review

Overview

This PR adds oxfmt (Oxc's formatter) and oxlint (via the oxc language server) as supplementary tools alongside the existing prettier/eslint setup. The changes are small (5 additions, 5 deletions) and well-scoped.


conform.lua — Formatter changes

What changed: oxfmt is added as the primary formatter for JS/TS filetypes, with prettier as a fallback via stop_after_first = true.

Looks good:

  • stop_after_first = true is the correct conform.nvim idiom for "try the first available formatter." If oxfmt is not installed, conform will silently fall back to prettier — no breakage on machines without oxfmt.
  • The change is consistently applied across all four JS/TS filetypes.

Suggestions:

  1. Potential code duplication. All four entries now share the same formatter list. Consider extracting it to avoid drift if you add more formatters later:

    local js_formatters = { "oxfmt", "prettier", stop_after_first = true }
    formatters_by_ft = {
      javascript        = js_formatters,
      typescript        = js_formatters,
      javascriptreact   = js_formatters,
      typescriptreact   = js_formatters,
      ...
    }
  2. oxfmt is still early-stage. As of early 2026, oxfmt is not yet at 1.0 and has known formatting differences from prettier. This is a stylistic note rather than a blocker, but worth flagging in a team/shared config.


nvim-lspconfig.lua — LSP changes

What changed: "oxc" is added to mason-lspconfig's ensure_installed list.

Potential issue — server name accuracy:
Mason-lspconfig maps Neovim LSP server names to Mason package names. The oxc language server's Neovim LSP name should be verified against the current mason-lspconfig server mapping list. If the name is wrong, mason will silently fail to install it. Double-check that "oxc" is the registered name (some versions use "oxc_language_server").

Potential issue — duplicate diagnostics:
Both eslint and oxc (oxlint) will now run simultaneously on JS/TS files. This can result in duplicate or conflicting lint diagnostics (e.g., the same rule surfacing twice with different formatting). Consider:

  • Disabling overlapping oxlint rules if both servers are active at the same time, or
  • Adding a note in the PR/docs that eslint should be disabled per-project when oxlint is the preferred linter.

Security

No security concerns. These are local Neovim tooling changes with no network exposure beyond the initial Mason install.

Test Coverage

The test plan in the PR description is solid and covers the key scenarios (with/without oxfmt, oxlint presence, eslint coexistence). No automated tests are applicable here given it's Neovim config.


Summary

Area Status
Correctness stop_after_first fallback is correct
Conventions ✅ Follows existing conform.lua/lspconfig patterns
Risk ⚠️ Verify "oxc" mason server name; watch for duplicate diagnostics with eslint
Quality 💡 Minor: consider extracting shared JS/TS formatter list to reduce duplication

Overall a clean, well-motivated change. The two items worth a quick verification before merging: the mason server name for oxc, and whether you want to address the potential eslint+oxlint overlap.

@rikuson rikuson merged commit b3c5a4e into master Apr 24, 2026
3 checks passed
@rikuson rikuson deleted the worktree-luminous-churning-kettle branch April 24, 2026 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant