@blogic-cz/oxc-config

中文文档
1.5.7发布于 2026/04/17MITTypeScriptES Module近 30 天下载 2031

Shared oxlint and oxfmt configs for blogic projects — layered TypeScript, React, and formatter presets

原始使用文档
文档目录13 节
  1. Configs
  2. Linter (oxlint)
  3. Formatter (oxfmt)
  4. Usage
  5. Linter
  6. Formatter
  7. What's included
  8. Linter — categories (error by default)
  9. Linter — key rules (all error )
  10. Linter — React layer adds
  11. Linter — shared overrides
  12. Formatter — what's shared
  13. License

@blogic-cz/oxc-config

Shared oxlint and oxfmt configs for blogic projects. Layered TypeScript, React, and formatter presets.

Configs

Linter (oxlint)

ConfigUse casePlugins
.oxlintrc.ts.jsonTypeScript projects (CLI, services, libraries)eslint, import, node, oxc, promise, typescript, unicorn, vitest
.oxlintrc.ts-react.jsonReact + TypeScript projectsextends ts.json + jsx-a11y, react, react-perf

Formatter (oxfmt)

ConfigUse caseWhat's shared
.oxfmtrc.base.jsoncAll projectssemi, quotes, width, tabs, import sort groups, ignore patterns

Note: sortImports.internalPattern and sortTailwindcss are project-specific — set them in your local .oxfmtrc.jsonc.

Usage

Install:

bun add -d @blogic-cz/oxc-config

Linter

In your project's .oxlintrc.json:

{
  "extends": ["@blogic-cz/oxc-config/oxlint/ts-react"],
  "rules": {
    // project-specific rules only
  },
  "overrides": [
    // project-specific overrides only
  ]
}

For non-React projects:

{
  "extends": ["@blogic-cz/oxc-config/oxlint/ts"]
}

Formatter

oxfmt doesn't support extends yet, so copy the base and add project-specific settings:

cp node_modules/@blogic-cz/oxc-config/.oxfmtrc.base.jsonc .oxfmtrc.jsonc

Then add your project-specific sortImports.internalPattern and sortTailwindcss:

{
  // ... base settings from @blogic-cz/oxc-config ...
  "sortImports": {
    "internalPattern": ["@/", "@your-project/"],
    "groups": [ /* already in base */ ]
  },
  "sortTailwindcss": {
    "stylesheet": "./apps/web-app/src/styles/app.css",
    "functions": ["clsx", "cn"]
  }
}

What's included

Linter — categories (error by default)

  • correctness
  • perf
  • suspicious

Linter — key rules (all error)

  • No any, no as Type suppression, consistent type imports
  • No relative parent imports, no import cycles, no default exports
  • eqeqeq, require-await, no-var
  • unicorn/consistent-function-scoping, unicorn/prefer-set-has
  • promise/always-return
  • oxc/no-map-spread

Linter — React layer adds

  • jsx-a11y/* accessibility rules
  • react/rules-of-hooks, react-hooks/exhaustive-deps
  • react/no-array-index-key, react/self-closing-comp

Linter — shared overrides

Test files, scripts, and tooling paths (.claude, .agents, .opencode) have relaxed rules where appropriate.

Formatter — what's shared

  • semi: true, singleQuote: false, printWidth: 60
  • tabWidth: 2, useTabs: false, trailingComma: "es5"
  • Import sort groups (type-first, then builtin/external, then internal)
  • Standard ignore patterns (assets, build output, node_modules)

License

MIT

版本与发布记录

@blogic-cz/oxc-config 共发布 11 个版本,首次发布于 2026/03/16;过去 12 个月发布了 11 个版本。

版本发布日期距今
1.5.7latest2026/04/176 个月前
1.5.62026/04/146 个月前
1.5.52026/04/136 个月前
1.5.42026/04/136 个月前
1.4.12026/04/027 个月前
1.4.02026/03/277 个月前

关于 @blogic-cz/oxc-config 的常见问题

@blogic-cz/oxc-config 是什么?

Shared oxlint and oxfmt configs for blogic projects — layered TypeScript, React, and formatter presets

如何安装 @blogic-cz/oxc-config?

在项目目录运行 npm install @blogic-cz/oxc-config,或使用 pnpm add / yarn add / bun add。

@blogic-cz/oxc-config 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@blogic-cz/oxc-config 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@blogic-cz/oxc-config 可以商用吗?

@blogic-cz/oxc-config 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@blogic-cz/oxc-config 的下载量有多少?

根据 npm 官方下载统计,@blogic-cz/oxc-config 在 2026/10/09 – 2026/11/07 这 30 天内被下载 2,031 次,日均约 68 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@blogic-cz/oxc-config 还在维护吗?

最新版本 1.5.7 发布于 2026/04/17(6 个月前);至今共发布 11 个版本,其中过去 12 个月发布了 11 个;首次发布于 2026/03/16。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。