Skip to content

편집기 설정

편집기 확장 프로그램은 프로젝트 내의 oxfmt --lsp를 사용하므로, oxfmt는 로컬에 설치되어야 합니다.

Oxfmt를 설치하려면 빠른 시작을 참조하세요.

지원되는 편집기

VS Code

설치

공식 Oxc VS Code 확장 프로그램을 다음에서 다운로드하세요:

이 확장 프로그램은 다른 VS Code 기반 편집기와도 호환됩니다, 포함된 Cursor도 포함합니다.

팀 설정

  1. 기여자에게 확장 프로그램 추천하기:

.vscode/extensions.json:

.vscode/extensions.json
json
{
  "recommendations": ["oxc.oxc-vscode"]
}
  1. .vscode/settings.json에서 저장 시 형식 지정 활성화하기:
.vscode/settings.json
json
{
  "oxc.fmt.configPath": ".oxfmtrc.json",
  "editor.defaultFormatter": "oxc.oxc-vscode",
  "editor.formatOnSave": true
}

언어별로 설정하려면:

.vscode/settings.json
json
{
  "[javascript]": {
    "editor.defaultFormatter": "oxc.oxc-vscode",
    "editor.formatOnSave": true
  },
  "[typescript]": {
    "editor.defaultFormatter": "oxc.oxc-vscode",
    "editor.formatOnSave": true
  }
}

참조

Zed

설치

참조

JetBrains

IntelliJ IDEA 및 WebStorm.

설치

참조

Neovim

nvim-lspconfig

sh
npm i -g oxfmt
lua
vim.lsp.enable('oxfmt')

conform.nvim

lua
require("conform").setup({
  formatters_by_ft = {
    javascript = { "oxfmt" },
    javascriptreact = { "oxfmt" },
    typescript = { "oxfmt" },
    typescriptreact = { "oxfmt" },
    json = { "oxfmt" },
    vue = { "oxfmt" },
  },
})

coc.nvim

vim
:CocInstall coc-oxc

기타 편집기

LSP 지원이 있는 편집기(에마크스, 헬릭스, 서브라임)의 경우 다음을 구성하세요:

sh
oxfmt --lsp

또는, LSP 지원이 없는 편집기의 경우:

sh
cat foo/bar.js | oxfmt --stdin-filepath dummy.js --config ./path/to/config.json

참조