From 94530e599ab1e7ee49f31c50181de1c139a31a2e Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Sat, 12 Sep 2026 22:12:42 -0400 Subject: [PATCH 1/8] Add oxfmt --- autoload/ale/fix/registry.vim | 5 +++++ autoload/ale/fixers/oxfmt.vim | 31 +++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 autoload/ale/fixers/oxfmt.vim diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 0770e0f1b6..013b6533eb 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -176,6 +176,11 @@ let s:default_registry = { \ 'suggested_filetypes': ['javascript', 'typescript', 'astro'], \ 'description': 'Apply eslint --fix to a file.', \ }, +\ 'oxfmt': { +\ 'function': 'ale#fixers#oxfmt#Fix', +\ 'suggested_filetypes': ['javascript', 'typescript'], +\ 'description': 'Apply oxfmt to a file.', +\ }, \ 'mix_format': { \ 'function': 'ale#fixers#mix_format#Fix', \ 'suggested_filetypes': ['elixir'], diff --git a/autoload/ale/fixers/oxfmt.vim b/autoload/ale/fixers/oxfmt.vim new file mode 100644 index 0000000000..9a968bc93c --- /dev/null +++ b/autoload/ale/fixers/oxfmt.vim @@ -0,0 +1,31 @@ +call ale#Set('javascript_oxfmt_executable', 'oxfmt') +call ale#Set('javascript_oxfmt_use_global', get(g:, 'ale_use_global_executables', 0)) +call ale#Set('javascript_oxfmt_options', '') + +function! ale#fixers#oxfmt#GetExecutable(buffer) abort + return ale#path#FindExecutable(a:buffer, 'javascript_oxfmt', [ + \ 'node_modules/.bin/oxfmt', + \]) +endfunction + +function! ale#fixers#oxfmt#Fix(buffer) abort + let l:executable = ale#fixers#oxfmt#GetExecutable(a:buffer) + let l:options = ale#Var(a:buffer, 'javascript_oxfmt_options') + + " Needs oxfmt with https://github.com/oxc-project/oxc/pull/16868 + return { + \ 'cwd': ale#fixers#oxfmt#GetCwd(a:buffer), + \ 'command': ale#Escape(l:executable) + \ . ale#Pad(l:options) + \ . ' --stdin-filepath %s', + \} + +endfunction + +function! ale#fixers#oxfmt#GetCwd(buffer) abort + let l:config = ale#path#FindNearestFile(a:buffer, '.oxfmtrc.json') + + " Fall back to the directory of the buffer + return !empty(l:config) ? fnamemodify(l:config, ':h') : '%s:h' +endfunction + From b71e485111669b2e7bcca8b365eef2bc19f2f9b9 Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Sun, 13 Sep 2026 20:28:03 -0400 Subject: [PATCH 2/8] extend list of oxfmt support --- autoload/ale/fix/registry.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index 013b6533eb..fa0036f1a6 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -178,7 +178,7 @@ let s:default_registry = { \ }, \ 'oxfmt': { \ 'function': 'ale#fixers#oxfmt#Fix', -\ 'suggested_filetypes': ['javascript', 'typescript'], +\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'toml', 'yaml'], \ 'description': 'Apply oxfmt to a file.', \ }, \ 'mix_format': { From 4b4051ec286ba56cedbfb8a3990ccba5d3bd47c9 Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Sat, 12 Sep 2026 22:59:47 -0400 Subject: [PATCH 3/8] Add oxlint support --- ale_linters/javascript/oxlint.vim | 8 ++++++ ale_linters/typescript/oxlint.vim | 9 +++++++ autoload/ale/handlers/oxlint.vim | 41 +++++++++++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 ale_linters/javascript/oxlint.vim create mode 100644 ale_linters/typescript/oxlint.vim create mode 100644 autoload/ale/handlers/oxlint.vim diff --git a/ale_linters/javascript/oxlint.vim b/ale_linters/javascript/oxlint.vim new file mode 100644 index 0000000000..6f9873196e --- /dev/null +++ b/ale_linters/javascript/oxlint.vim @@ -0,0 +1,8 @@ +call ale#linter#Define('javascript', { +\ 'name': 'oxlint', +\ 'lsp': 'stdio', +\ 'executable': function('ale#handlers#oxlint#GetExecutable'), +\ 'command': '%e --lsp', +\ 'project_root': function('ale#handlers#oxlint#GetProjectRoot'), +\ 'initialization_options': function('ale#handlers#oxlint#GetInitializationOptions'), +\}) diff --git a/ale_linters/typescript/oxlint.vim b/ale_linters/typescript/oxlint.vim new file mode 100644 index 0000000000..416b598c8e --- /dev/null +++ b/ale_linters/typescript/oxlint.vim @@ -0,0 +1,9 @@ +call ale#linter#Define('typescript', { +\ 'name': 'oxlint', +\ 'lsp': 'stdio', +\ 'executable': function('ale#handlers#oxlint#GetExecutable'), +\ 'command': '%e --lsp', +\ 'project_root': function('ale#handlers#oxlint#GetProjectRoot'), +\ 'initialization_options': function('ale#handlers#oxlint#GetInitializationOptions'), +\}) + diff --git a/autoload/ale/handlers/oxlint.vim b/autoload/ale/handlers/oxlint.vim new file mode 100644 index 0000000000..12bb2ff78b --- /dev/null +++ b/autoload/ale/handlers/oxlint.vim @@ -0,0 +1,41 @@ +call ale#Set('javascript_oxlint_use_global', get(g:, 'ale_use_global_executables', 0)) + +function! ale#handlers#oxlint#GetExecutable(buffer) abort + return ale#path#FindExecutable(a:buffer, 'javascript_oxlint', [ + \ 'node_modules/.bin/oxlint', + \]) +endfunction + +function! ale#handlers#oxlint#GetProjectRoot(buffer) abort + let l:possible_project_roots = [ + \ '.oxlintrc.json', + \ '.oxlintrc.jsonc', + \ 'oxlint.config.ts', + \ 'oxlint.config.mts', + \ 'package.json', + \ bufname(a:buffer), + \] + + for l:possible_root in l:possible_project_roots + let l:project_root = ale#path#FindNearestFile(a:buffer, l:possible_root) + + if empty(l:project_root) + let l:project_root = ale#path#FindNearestDirectory(a:buffer, l:possible_root) + endif + + if !empty(l:project_root) + " dir:p expands to /full/path/to/dir/ whereas + " file:p expands to /full/path/to/file (no trailing slash) + " Appending '/' ensures that :h:h removes the path's last segment + " regardless of whether it is a directory or not. + return fnamemodify(l:project_root . '/', ':p:h:h') + endif + endfor + + return '' +endfunction + +function! ale#handlers#oxlint#GetInitializationOptions(buffer) abort + let l:options = {} + return l:options +endfunction From 7aa908f665272e04e37eb33a4d65d590ec9f0860 Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Sun, 13 Sep 2026 21:39:12 -0400 Subject: [PATCH 4/8] fixup --- autoload/ale/fix/registry.vim | 2 +- autoload/ale/handlers/oxlint.vim | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/ale/fix/registry.vim b/autoload/ale/fix/registry.vim index fa0036f1a6..4f1b79d270 100644 --- a/autoload/ale/fix/registry.vim +++ b/autoload/ale/fix/registry.vim @@ -178,7 +178,7 @@ let s:default_registry = { \ }, \ 'oxfmt': { \ 'function': 'ale#fixers#oxfmt#Fix', -\ 'suggested_filetypes': ['javascript', 'typescript', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'toml', 'yaml'], +\ 'suggested_filetypes': ['javascript', 'typescript', 'typescriptreact', 'css', 'less', 'scss', 'json', 'json5', 'graphql', 'toml', 'yaml'], \ 'description': 'Apply oxfmt to a file.', \ }, \ 'mix_format': { diff --git a/autoload/ale/handlers/oxlint.vim b/autoload/ale/handlers/oxlint.vim index 12bb2ff78b..95cbd08c6c 100644 --- a/autoload/ale/handlers/oxlint.vim +++ b/autoload/ale/handlers/oxlint.vim @@ -1,3 +1,4 @@ +call ale#Set('javascript_oxlint_executable', 'oxlint') call ale#Set('javascript_oxlint_use_global', get(g:, 'ale_use_global_executables', 0)) function! ale#handlers#oxlint#GetExecutable(buffer) abort From 0899feaac40d2f5c506e498d74adfc39d4864c49 Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Sun, 20 Sep 2026 20:53:09 -0400 Subject: [PATCH 5/8] Update docs --- doc/ale-css.txt | 6 +++ doc/ale-graphql.txt | 6 +++ doc/ale-javascript.txt | 58 +++++++++++++++++++++++ doc/ale-json.txt | 6 +++ doc/ale-json5.txt | 6 +++ doc/ale-less.txt | 6 +++ doc/ale-scss.txt | 6 +++ doc/ale-supported-languages-and-tools.txt | 11 +++++ doc/ale-toml.txt | 6 +++ doc/ale-typescript.txt | 12 +++++ doc/ale-yaml.txt | 6 +++ 11 files changed, 129 insertions(+) diff --git a/doc/ale-css.txt b/doc/ale-css.txt index 3fa71f4264..338323109b 100644 --- a/doc/ale-css.txt +++ b/doc/ale-css.txt @@ -56,6 +56,12 @@ them reads `./.fecsrc` as the default configuration file. See: |ale-javascript-fecs|. +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + =============================================================================== prettier *ale-css-prettier* diff --git a/doc/ale-graphql.txt b/doc/ale-graphql.txt index 5a1e096f60..7f454aa473 100644 --- a/doc/ale-graphql.txt +++ b/doc/ale-graphql.txt @@ -19,6 +19,12 @@ You will need the GraphQL ESLint plugin installed for this to work. =============================================================================== gqlint *ale-graphql-gqlint* +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + =============================================================================== prettier *ale-graphql-prettier* diff --git a/doc/ale-javascript.txt b/doc/ale-javascript.txt index ed67c2d4d6..d3ce3a75cb 100644 --- a/doc/ale-javascript.txt +++ b/doc/ale-javascript.txt @@ -255,6 +255,64 @@ g:ale_javascript_jshint_use_global See |ale-integrations-local-executables| +=============================================================================== +oxfmt *ale-javascript-oxfmt* + + *ale-options.javascript_oxfmt_executable* + *g:ale_javascript_oxfmt_executable* + *b:ale_javascript_oxfmt_executable* +javascript_oxfmt_executable +g:ale_javascript_oxfmt_executable + Type: |String| + Default: `'oxfmt'` + + See |ale-integrations-local-executables| + + *ale-options.javascript_oxfmt_options* + *g:ale_javascript_oxfmt_options* + *b:ale_javascript_oxfmt_options* +javascript_oxfmt_options +g:ale_javascript_oxfmt_options + Type: |String| + Default: `''` + + This variable can be set to pass additional options to oxfmt. + + +=============================================================================== +oxlint *ale-javascript-oxlint* + + *ale-options.javascript_oxlint_executable* + *g:ale_javascript_oxlint_executable* + *b:ale_javascript_oxlint_executable* +javascript_oxlint_executable +g:ale_javascript_oxlint_executable + Type: |String| + Default: `'oxlint'` + + See |ale-integrations-local-executables| + + *ale-options.javascript_oxlint_options* + *g:ale_javascript_oxlint_options* + *b:ale_javascript_oxlint_options* +javascript_oxlint_options +g:ale_javascript_oxlint_options + Type: |String| + Default: `''` + + This variable can be set to pass additional options to oxlint. + + *ale-options.javascript_oxlint_use_global* + *g:ale_javascript_oxlint_use_global* + *b:ale_javascript_oxlint_use_global* +javascript_oxlint_use_global +g:ale_javascript_oxlint_use_global + Type: |Number| + Default: `get(g:, 'ale_use_global_executables', 0)` + + See |ale-integrations-local-executables| + + =============================================================================== prettier *ale-javascript-prettier* diff --git a/doc/ale-json.txt b/doc/ale-json.txt index 1e9a0f6517..4de37e2044 100644 --- a/doc/ale-json.txt +++ b/doc/ale-json.txt @@ -190,6 +190,12 @@ g:ale_json_jq_filters This option can be changed to pass custom filters to `jq`. +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + =============================================================================== prettier *ale-json-prettier* diff --git a/doc/ale-json5.txt b/doc/ale-json5.txt index bafa60d176..716c9701a1 100644 --- a/doc/ale-json5.txt +++ b/doc/ale-json5.txt @@ -11,5 +11,11 @@ The `eslint` linter for JSON uses the JavaScript options for `eslint`; see: You will need a JSON5 ESLint plugin installed for this to work. +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + =============================================================================== vim:tw=78:ts=2:sts=2:sw=2:ft=help:norl: diff --git a/doc/ale-less.txt b/doc/ale-less.txt index ca02d056e4..871f349499 100644 --- a/doc/ale-less.txt +++ b/doc/ale-less.txt @@ -42,6 +42,12 @@ g:ale_less_lessc_use_global See |ale-integrations-local-executables| +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + =============================================================================== prettier *ale-less-prettier* diff --git a/doc/ale-scss.txt b/doc/ale-scss.txt index 337bc80dc3..9af27edb8d 100644 --- a/doc/ale-scss.txt +++ b/doc/ale-scss.txt @@ -8,6 +8,12 @@ dprint *ale-scss-dprint* See |ale-dprint-options| and https://dprint.dev/plugins/malva/. +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + =============================================================================== prettier *ale-scss-prettier* diff --git a/doc/ale-supported-languages-and-tools.txt b/doc/ale-supported-languages-and-tools.txt index f8711d89b6..72d3a95c1d 100644 --- a/doc/ale-supported-languages-and-tools.txt +++ b/doc/ale-supported-languages-and-tools.txt @@ -143,6 +143,7 @@ Notes: * `csslint` * dprint * `fecs` + * `oxfmt` * `prettier` * `stylelint` * Cucumber @@ -265,6 +266,7 @@ Notes: * dprint * `eslint` * `gqlint` + * `oxfmt` * `prettier` * Groovy * `npm-groovy-lint` @@ -354,6 +356,8 @@ Notes: * `flow` * `jscs` * `jshint` + * `oxfmt` + * `oxlint` * `prettier` * `prettier-eslint` * `prettier-standard` @@ -375,6 +379,7 @@ Notes: * `jq` * `json.tool` * `jsonlint` + * `oxfmt` * `prettier` * `spectral` * JSON5 @@ -409,6 +414,7 @@ Notes: * Less * dprint * `lessc` + * `oxfmt` * `prettier` * `stylelint` * LilyPond @@ -687,6 +693,7 @@ Notes: * `scalastyle` * SCSS * dprint + * `oxfmt` * `prettier` * `sass-lint` * `scss-lint` @@ -754,6 +761,7 @@ Notes: * `thriftcheck` * TOML * `dprint` + * `oxfmt` * `tombi` * Twig * `dprint` @@ -764,6 +772,8 @@ Notes: * `dprint` * `eslint` * `fecs` + * `oxfmt` + * `oxlint` * `prettier` * `standard` * `tslint` @@ -820,6 +830,7 @@ Notes: * `circleci`!! * `dprint` * `gitlablint` + * `oxfmt` * `prettier` * `spectral` * `swaglint` diff --git a/doc/ale-toml.txt b/doc/ale-toml.txt index a5049e86b8..95a3cb5baa 100644 --- a/doc/ale-toml.txt +++ b/doc/ale-toml.txt @@ -8,6 +8,12 @@ dprint *ale-toml-dprint* See |ale-dprint-options| and https://dprint.dev/plugins/toml/. +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + =============================================================================== tombi *ale-toml-tombi* diff --git a/doc/ale-typescript.txt b/doc/ale-typescript.txt index 4d727c7f38..d87ed108cb 100644 --- a/doc/ale-typescript.txt +++ b/doc/ale-typescript.txt @@ -137,6 +137,18 @@ the two languages are, the `eslint` linter for TypeScript uses the JavaScript options for `eslint` too. See: |ale-javascript-eslint|. +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + +=============================================================================== +oxlint *ale-typescript-oxlint* + +See |ale-javascript-oxlint| for information about the available options. + + =============================================================================== prettier *ale-typescript-prettier* diff --git a/doc/ale-yaml.txt b/doc/ale-yaml.txt index 2b5fd6fd2d..9945c11328 100644 --- a/doc/ale-yaml.txt +++ b/doc/ale-yaml.txt @@ -79,6 +79,12 @@ dprint *ale-yaml-dprint* See |ale-dprint-options| and https://dprint.dev/plugins/pretty_yaml/. +=============================================================================== +oxfmt *ale-typescript-oxfmt* + +See |ale-javascript-oxfmt| for information about the available options. + + =============================================================================== prettier *ale-yaml-prettier* From 5735385984ed1e04301d321983730412a2c3c6f0 Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Sun, 20 Sep 2026 22:06:17 -0400 Subject: [PATCH 6/8] Add oxfmt test --- test/fixers/test_oxfmt_fixer_callback.vader | 25 +++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 test/fixers/test_oxfmt_fixer_callback.vader diff --git a/test/fixers/test_oxfmt_fixer_callback.vader b/test/fixers/test_oxfmt_fixer_callback.vader new file mode 100644 index 0000000000..ae5c283f5f --- /dev/null +++ b/test/fixers/test_oxfmt_fixer_callback.vader @@ -0,0 +1,25 @@ +Before: + Save g:ale_sql_oxfmt_executable + Save g:ale_sql_oxfmt_options + +After: + Restore + +Execute(The oxfmt callback should return the correct default values): + AssertEqual + \ { + \ 'command': ale#Escape('oxfmt') + \ }, + \ ale#fixers#oxfmt#Fix(bufnr('')) + +Execute(The oxfmt executable and options should be configurable): + let g:ale_sql_oxfmt_executable = '/path/to/sqlfmt' + let g:ale_sql_oxfmt_options = '--write' + + AssertEqual + \ { + \ 'command': ale#Escape('/path/to/oxfmt') + \ . ' -w' + \ . ' -write', + \ }, + \ ale#fixers#oxfmt#Fix(bufnr('')) From 7b75a686fa01d92f324561d6a988853e7faa7a85 Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Tue, 22 Sep 2026 08:04:22 -0400 Subject: [PATCH 7/8] Adding header content to new oxlint files --- ale_linters/javascript/oxlint.vim | 3 +++ ale_linters/typescript/oxlint.vim | 3 +++ autoload/ale/fixers/oxfmt.vim | 3 +++ autoload/ale/handlers/oxlint.vim | 2 ++ 4 files changed, 11 insertions(+) diff --git a/ale_linters/javascript/oxlint.vim b/ale_linters/javascript/oxlint.vim index 6f9873196e..c8c81a1100 100644 --- a/ale_linters/javascript/oxlint.vim +++ b/ale_linters/javascript/oxlint.vim @@ -1,3 +1,6 @@ +" Author: Jeff Miccolis +" Description: oxlint for JavaScript files. + call ale#linter#Define('javascript', { \ 'name': 'oxlint', \ 'lsp': 'stdio', diff --git a/ale_linters/typescript/oxlint.vim b/ale_linters/typescript/oxlint.vim index 416b598c8e..85d858e642 100644 --- a/ale_linters/typescript/oxlint.vim +++ b/ale_linters/typescript/oxlint.vim @@ -1,3 +1,6 @@ +" Author: Jeff Miccolis +" Description: oxlint for TypeScript files. + call ale#linter#Define('typescript', { \ 'name': 'oxlint', \ 'lsp': 'stdio', diff --git a/autoload/ale/fixers/oxfmt.vim b/autoload/ale/fixers/oxfmt.vim index 9a968bc93c..5c4ba99f33 100644 --- a/autoload/ale/fixers/oxfmt.vim +++ b/autoload/ale/fixers/oxfmt.vim @@ -1,3 +1,6 @@ +" Author: Jeff Miccolis +" Description: Fixing files with oxlint. + call ale#Set('javascript_oxfmt_executable', 'oxfmt') call ale#Set('javascript_oxfmt_use_global', get(g:, 'ale_use_global_executables', 0)) call ale#Set('javascript_oxfmt_options', '') diff --git a/autoload/ale/handlers/oxlint.vim b/autoload/ale/handlers/oxlint.vim index 95cbd08c6c..8fddd336e2 100644 --- a/autoload/ale/handlers/oxlint.vim +++ b/autoload/ale/handlers/oxlint.vim @@ -1,3 +1,5 @@ +" Author: Jeff Miccolis + call ale#Set('javascript_oxlint_executable', 'oxlint') call ale#Set('javascript_oxlint_use_global', get(g:, 'ale_use_global_executables', 0)) From 4a85a518f771dafda2dbcb2699bd63c5448dc5b9 Mon Sep 17 00:00:00 2001 From: Jeff Miccolis Date: Tue, 22 Sep 2026 21:05:30 -0400 Subject: [PATCH 8/8] Support oxlint initialization options --- autoload/ale/handlers/oxlint.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/autoload/ale/handlers/oxlint.vim b/autoload/ale/handlers/oxlint.vim index 8fddd336e2..11009b6e2e 100644 --- a/autoload/ale/handlers/oxlint.vim +++ b/autoload/ale/handlers/oxlint.vim @@ -2,6 +2,7 @@ call ale#Set('javascript_oxlint_executable', 'oxlint') call ale#Set('javascript_oxlint_use_global', get(g:, 'ale_use_global_executables', 0)) +call ale#Set('javascript_oxlint_options', {}) function! ale#handlers#oxlint#GetExecutable(buffer) abort return ale#path#FindExecutable(a:buffer, 'javascript_oxlint', [ @@ -39,6 +40,6 @@ function! ale#handlers#oxlint#GetProjectRoot(buffer) abort endfunction function! ale#handlers#oxlint#GetInitializationOptions(buffer) abort - let l:options = {} + let l:options = ale#Var(a:buffer, 'javascript_oxlint_options') return l:options endfunction