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 (and Cursor, etc.)
- Zed
- JetBrains
- coc.nvim
- Other 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
- Recommend the extension for contributors:
.vscode/extensions.json:
json
{
"recommendations": ["oxc.oxc-vscode"]
}- Enable format on save in
.vscode/settings.json:
json
{
"oxc.fmt.configPath": ".oxfmtrc.json",
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
}To set per language:
json
{
"[javascript]": {
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
},
"[typescript]": {
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true
}
}Reference
Zed
Install
Reference
JetBrains
IntelliJ IDEA and WebStorm.
Install
Reference
coc.nvim
Install
vim
:CocInstall coc-oxcReference
Other editors
For editors with LSP support (Neovim, Emacs, Helix, Sublime), configure:
bash
oxfmt --lspVia stdin
For editors without LSP support:
sh
cat foo/bar.js | oxfmt --stdin-filepath f.js --config ./path/to/config.json