Socket
Book a DemoInstallSign in
Socket

@aplus-frontend/oxfmt-config

Package Overview
Dependencies
Maintainers
8
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aplus-frontend/oxfmt-config

OXC formatter config preset for aplus team.

latest
npmnpm
Version
0.0.1
Version published
Maintainers
8
Created
Source

@aplus-frontend/oxfmt-config

🚀 Ultra-fast OXC Formatter config preset for Aplus frontend team

基于 Rust 编写的高性能代码格式化工具配置预设

NPM Version NPM Downloads NPM License

✨ 特性

  • ⚡️ 极速格式化 - 基于 Rust 的 OXC 引擎,比 Prettier 快 10-50 倍
  • 🎯 零配置 - 开箱即用的团队统一配置
  • 📦 轻量级 - 无需安装 Prettier 及其插件
  • 🔧 兼容性好 - 支持 JavaScript、TypeScript、Vue、React 等

📦 安装

# 只需安装这一个包,无需 prettier
pnpm add @aplus-frontend/oxfmt-config -D

🚀 使用方法

1. 安装包

# 只需安装这一个包,无需 prettier
pnpm add @aplus-frontend/oxfmt-config -D

2. 添加格式化脚本

package.json 中添加:

{
  "scripts": {
    "format": "oxfmt",
    "format:check": "oxfmt --check"
  }
}

注意:包内已包含 oxfmt 可执行文件和配置,无需额外安装或配置。

3. 运行格式化

# 格式化所有文件(默认)
pnpm format

# 检查格式化(不修改文件)
pnpm format:check

# 格式化特定文件
pnpm format src/**/*.{js,ts,vue}

⚙️ 配置选项

此预设包含以下配置:

选项说明
printWidth80每行最大字符数
indentWidth2缩进宽度
useTabsfalse使用空格而非制表符
semicolonsalways始终使用分号
singleQuotetrue使用单引号
trailingCommanone不使用尾随逗号
bracketSpacingtrue对象字面量括号内有空格
arrowParenstrue箭头函数参数总是使用括号

🔄 从 Prettier 迁移

如果你正在从 @aplus-frontend/prettier-config 迁移:

优势

  • ✅ 格式化速度提升 10-50 倍
  • ✅ 更小的依赖体积
  • ✅ 更快的安装速度
  • ✅ 配置完全兼容

迁移步骤

  • 卸载 Prettier 相关依赖:
pnpm remove prettier @aplus-frontend/prettier-config
  • 安装 OXC Formatter 配置:
pnpm add @aplus-frontend/oxfmt-config -D
  • 更新配置文件(删除 .prettierrc,创建 .oxc.json

  • 更新 package.json 脚本:

{
  "scripts": {
    "format": "oxc format --write .",
    "format:check": "oxc format --check ."
  }
}

📚 更多信息

  • OXC 官方文档
  • OXC Formatter 文档

📄 License

MIT © Aplus Frontend Team

Keywords

@aplus-frontend

FAQs

Package last updated on 12 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts