外掛
Oxlint 開箱即用地支援多個最受歡迎的 ESLint 外掛,並且已經實作了 `recommended` 設定中的大多數規則。
警告
Oxlint 目前不支援自訂外掛。我們計劃在未來實作此功能。您可以在 我們的待辦事項上追蹤其狀態。
啟用外掛
您可以使用 `--<plugin-name>-plugin` CLI 標記來啟用外掛。例如,要啟用 `eslint-plugin-import`,請執行
sh
oxlint --import-plugin
啟用後,您已啟用類別中的規則將自動開啟。例如,
sh
oxlint --import-plugin -W correctness -W suspicious
將啟用 `import` 外掛中的所有 `correctness` 和 `suspicious` 規則,以及基本規則集。請注意,`correctness` 規則預設為開啟。
停用外掛
預設會啟用多個外掛,並在下方列出。您可以使用 `--no-<plugin-name>-plugin` 標記來停用它們。例如,要停用 `eslint-plugin-unicorn`,請執行
sh
oxlint --no-unicorn-plugin
資訊
執行 `oxlint --help` 以查看啟用或停用外掛的完整標記列表。
支援的外掛
資訊
您也可以在 GitHub 上的 `linter product plan` 問題中找到此資訊。
外掛名稱 | 預設? | 問題 | 備註 |
---|---|---|---|
typescript-eslint | ✅ | #2180 | 來自 `@typescript-eslint/eslint-plugin` 的 Typescript 特定規則。我們目前不支援類型感知規則。 |
eslint-plugin-unicorn | ✅ | #684 | |
eslint-plugin-react | ✅ | #1022 | |
eslint-plugin-react-hooks | ✅ | #2174 | |
eslint-plugin-react-perf | #2041 | ||
eslint-plugin-next | #1929 | ||
oxc | ✅ | 不適用 | 自訂的 oxc 特定規則,以及一些從 deepscan 移植過來的規則 |
oxc-security | 不適用 | 自訂的 oxc 特定安全性和漏洞偵測規則。 | |
eslint-plugin-import | #1117 | ||
eslint-plugin-jsdoc | #1170 | ||
eslint-plugin-jsx-a11y | #1141 | ||
eslint-plugin-n | #493 | 規則使用 `node` 作為外掛前綴(例如, `node/no-exports-assign`) | |
eslint-plugin-promise | #4655 | ||
eslint-plugin-jest | #492 | ||
eslint-plugin-vitest | #4656 |
新增外掛
您是否有喜歡的 ESLint 外掛,希望在 Oxlint 中看到支援?請開啟 功能請求。請注意,我們沒有計劃支援需要特殊解析器的外掛中的規則,例如 `eslint-plugin-vue` 和 `eslint-plugin-svelte`,儘管我們樂於支援這些外掛中僅影響其原始檔中 script 標籤的規則。