Skip to content

Add support for OXC tools - oxfmt & oxlint - #5170

Open
miccolis wants to merge 8 commits into
dense-analysis:masterfrom
miccolis:oxc
Open

miccolis wants to merge 8 commits into
dense-analysis:masterfrom
miccolis:oxc

Conversation

@miccolis

Copy link
Copy Markdown

PR Adds support for tools provided by https://oxc.rs/
Refs #4997

I've been using this, in nvim, on a typescript project for a little over a week and both oxfmt and oxlint are working will in ALE. The PR does include first pass at tests for oxfmt, but I was a bit unsure what a good model for LSP test would be here (e.g. deno's look very slim). If there is a good reference I'm very happy to add them.

I did try to run tests locally but ran into an issue in what looks like the docker build. I'm not sure I follow this, but it doesn't appear to be a test failure, but rather on the build.

...
find: /proc/tty/driver: Permission denied
The command '/bin/sh -c install_vim -tag v8.2.5172 -build                 -tag v9.2.0329 -build                 -tag neovim:v0.10.4 -build                 -tag neovim:v0.12.1 -build' returned a non-zero code: 1

Again, I realize tests could be further along and I'm more than willing to get them there with a bit of guidance. Thanks!

@miccolis
miccolis requested a review from w0rp as a code owner September 23, 2026 01:27
@sukima

sukima commented Nov 13, 2026

Copy link
Copy Markdown

Our team just introduced oxfmt to our project and this will be very helpful since I'm so not a VS Coder. Thank you!

@sukima

sukima commented Nov 13, 2026

Copy link
Copy Markdown

The eight commits are a little sparse in description and also don't follow atomic logical chunks. I had AI break them down into more focused commits.

Suggested commit structure

Commit 1: Add oxfmt fixer

Squash patches 1, 2, and the oxfmt portion of 4, plus the file header from 7.

The final state of oxfmt.vim and the registry entry are spread across three commits — the filetype list grows incrementally (javascript, typescript → adds CSS/JSON/etc → adds typescriptreact). None of those intermediate states are useful to preserve. The final filetype list and the complete implementation belong in one commit.

Files: autoload/ale/fixers/oxfmt.vim, autoload/ale/fix/registry.vim

Commit 2: Add oxlint linter

Squash patches 3, the oxlint portion of 4, 7 (oxlint headers), and 8.

Patches 3 and 4 together complete the executable setting that was simply missing from the initial commit. Patch 8 replaces the stub GetInitializationOptions body with the real one; the stub is never a useful checkpoint. The file headers in patch 7 are boilerplate that should have been in patch 3.

Files: ale_linters/javascript/oxlint.vim, ale_linters/typescript/oxlint.vim, autoload/ale/handlers/oxlint.vim

Commit 3: Add docs for oxfmt and oxlint

Patch 5 as-is. Documentation is a clean, independent unit.

Files: all doc/ale-*.txt changes

Issues to fix before committing

Test file (patch 6) is broken and should not be committed yet. It appears to be a copy-paste from a SQL fixer test that was never properly adapted:

  • g:ale_sql_oxfmt_executable and g:ale_sql_oxfmt_options should be g:ale_javascript_oxfmt_executable / g:ale_javascript_oxfmt_options
  • The second Execute block sets the executable to /path/to/sqlfmt but asserts /path/to/oxfmt
  • It asserts flags -w and -write which don't appear anywhere in the implementation; the actual command uses --stdin-filepath %s
  • Neither test asserts the cwd key, which the fixer always returns
  • The Before block saves variables for the wrong namespace, so Restore won't clean up the right state

Fix the test, then it can either be a 4th commit or folded into commit 1.

Minor doc tag mismatch: Every per-language oxfmt section uses *ale-typescript-oxfmt* as the help tag regardless of the actual language (e.g., ale-css.txt says *ale-typescript-oxfmt*). The tags should match their host file: *ale-css-oxfmt*, *ale-json-oxfmt*, etc.

Hope that helps.

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.

2 participants