OXC 工具介绍
Vue 作者尤雨溪发布了 OXC 工具集,包含 oxfmt(格式化)和 oxlint(代码检查),旨在解决前端开发中工具速度慢的问题。
性能对比
oxfmt 性能 相比 Prettier,格式化速度提升约 45 倍;相比 Biome,快 2-3 倍。
oxlint 性能 相比 ESLint,检查速度提升 50-100 倍。已兼容 Vite、Vue、React、Next.js、AntDesign。
安装指南
快速体验
# 格式化文件
npx oxfmt@latest src/**/*.{js,ts,jsx,tsx}
# 检查代码
npx oxlint@latest src/**/*.{js,ts,jsx,tsx}
正式安装
npm install -D oxlint oxfmt
在 package.json 中配置脚本:
{
"scripts": {
"lint": "oxlint src/",
"lint:fix": "oxlint --fix src/",
"format": "oxfmt src/",
"format:check": "oxfmt --check src/"
}
}
配置说明
oxfmt 配置 (.oxfmtrc.json)
{"printWidth":80,"tabWidth":2,"semi":true


