Skip to content

Setup editors

Editor extensions use oxfmt --lsp from your project, so oxfmt must be installed locally.

See Quickstart to install Oxfmt.

Supported editors

VS Code

Install

Download the official Oxc VS Code extension from:

The extension is compatible with other VS Code-based editors, including Cursor.

Team setup

  1. Recommend the extension for contributors:

.vscode/extensions.json:

.vscode/extensions.json
json
{
  "recommendations": ["oxc.oxc-vscode"]
}
``````json [.vscode/settings.json]
{
  "oxc.fmt.configPath": ".oxfmtrc.json",
  "editor.defaultFormatter": "oxc.oxc-vscode",
  "editor.formatOnSave": true
}
``````json [.vscode/settings.json]
{
  "[javascript]": {
    "editor.defaultFormatter": "oxc.oxc-vscode",
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.defaultFormatter": "oxc.oxc-vscode",
    "editor.formatOnSave": true
  }
}
``````sh
npm i -g oxfmt
``````lua
vim.lsp.enable('oxfmt')
``````lua
require("conform").setup({
  formatters_by_ft = {
    javascript = { "oxfmt" },
    javascriptreact = { "oxfmt" },
    typescript = { "oxfmt" },
    typescriptreact = { "oxfmt" },
    json = { "oxfmt" },
    vue = { "oxfmt" },
  },
})
``````vim
:CocInstall coc-oxc
``````sh
oxfmt --lsp
``````sh
cat foo/bar.js | oxfmt --stdin-filepath dummy.js --config ./path/to/config.json