@aurelienbbn/oxlint-config

中文文档
0.8.0发布于 2026/09/30MITTypeScriptES Module零依赖构建来源已验证近 30 天下载 2100

对TypeScript项目有意见的严格可再使用的克林特配置.

中文使用文档
文档目录6 节
  1. 1个预设, 5个选入
  2. 什么预设集
  3. 每个冲突都解决一次
  4. 模糊测试标题失败
  5. 切入层
  6. 合同和迁移

@aurelienbn/克林特-配置

npm downloads CI license node

TypeScript 的严格氧化林: 每一个稳定的类别 error,类型意识,警告否认, 每条规则冲突解决.

pnpm add -D @aurelienbbn/oxlint-config oxlint oxlint-tsgolint
# oxlint >=1.82.0 <2.0.0 · oxlint-tsgolint ^7.0.2001 · Node ^22.19.0 || ^24.11.0
// oxlint.config.ts
import { defineStrictOxlintConfig } from "@aurelienbbn/oxlint-config";
import { defineConfig } from "oxlint";

export default defineConfig(
  defineStrictOxlintConfig({
    ignorePatterns: ["dist/**"],
  }),
);

返回平原 OxlintConfig: 直接或作为 Vite+ 工作的牛林 lint 配置, 不依赖 Vite+ .

1个预设, 5个选入

导出添加数
strictOxlintConfig预设对象
defineStrictOxlintConfig(overrides?, options?)预设 + 您的覆盖, 已克隆
withTanstackQueryLayer(config?, options?)官员 @tanstack/eslint-plugin-query,7条规则
withEffectTsgoLayer(config, { preset })官员 @effect/tsgo 预设 + 4 所有者规则
withImportGraphLayer(config?, { entrypoints? })🔌 import/no-cycle + 键 import/no-self-import
layerDirectionOverride({ files, forbidden, message })一个 overrides 禁止跨层进口
nurseryCandidateRules· 4个托儿所规则供审判

还: testFileGlobs, (中文(简体) ), vagueTestTitlePattern, (中文(简体) ), tanstackQueryRules, (中文(简体) ), tanstackQueryPluginSpecifier, (中文(简体) ), effectTsgoPluginName, (中文(简体) ), effectTsgoOwnerRules, (中文(简体) ), effectTsgoSettledRules, (中文(简体) ), effectIdiomRules, (中文(简体) ), importGraphRules,类型 OxlintConfig, (中文(简体) ), ImportGraphLayerOptions。 。 。 .

什么预设集

correctness  ██████  error      style       ██████  error
pedantic     ██████  error      suspicious  ██████  error
perf         ██████  error      nursery     ░░░░░░  off (pending upgrade review)
restriction  ██████  error

vitest 从不运行源文件,仅在 testFileGlobs数字 : vitest/require-hook 报告普通的顶级电话.

插件、 选项、 固定规则
密钥数值
pluginseslint, (中文(简体) ), typescript, (中文(简体) ), unicorn, (中文(简体) ), oxc, (中文(简体) ), node, (中文(简体) ), promise
optionstypeAware: true, (中文(简体) ), typeCheck: true, (中文(简体) ), denyWarnings: true, (中文(简体) ), reportUnusedDisableDirectives: "error"
envbuiltin: true, (中文(简体) ), node: true
overrides[0]vitest 打开插件 testFileGlobs =: **/*.{test,spec}.{ts,tsx,mts,cts,js,jsx,mjs,cjs}

plugins 替换了 oxlint 的默认设定, 因此四个默认值(eslint, (中文(简体) ), typescript, (中文(简体) ), unicorn, (中文(简体) ), oxc)在 node 财务报告和审定财务报表 promise。其他测试布局:添加 overrides 条目 plugins: ["vitest"]。 。 。 .

规则设置为什么
typescript/ban-ts-commentts-ignore 被禁绝, ts-expect-error 需要说明压制说为什么
typescript/no-explicit-any, (中文(简体) ), typescript/no-non-null-assertionerror标有名称
unicorn/filename-casekebabCase一个命名方案
eslint/no-underscore-dangle允许 _tag, (中文(简体) ), _tree, (中文(简体) ), __dirname标记的联盟, 节点全球
eslint/max-lines300,空白和注释行跳过计量码,而不是文件或材料回流
eslint/sort-keysoff密钥顺序带有意义: schema 字段、 表格列、 读入顺序配置
eslint/one-varnever分组后会编辑 noisier
oxc/no-async-await, (中文(简体) ), oxc/no-optional-chaining, (中文(简体) ), oxc/no-rest-spread-propertiesoff禁止现代语法而非缺陷
vitest/no-standalone-expectoff (测试文件)
typescript/no-unnecessary-conditionerror 名称( 关闭护士)需求 strictNullChecks· ; noUncheckedIndexedAccess 保持索引访问安静
typescript/switch-exhaustiveness-checkallowDefaultCaseForExhaustiveSwitch: false, (中文(简体) ), requireDefaultForNonUnion: true工会切换:每个成员,不 default; 其他开关 : default 所需经费

nurseryCandidateRules (不是在预设中;扩展为 rules 审判: typescript/prefer-optional-chain, (中文(简体) ), eslint/no-useless-assignment, (中文(简体) ), eslint/no-unreachable-loop, (中文(简体) ), promise/no-return-in-finally。 。 。 .

每个冲突都解决一次

关静静地为什么
eslint/no-ternaryunicorn/prefer-ternary, (中文(简体) ), eslint/no-nested-ternary没有..let 代码需要表达式; 禁入巢穴
node/no-top-level-awaitunicorn/prefer-top-level-await应用程序入口; 库重新启用节点规则
vitest/no-importing-vitest-globalsvitest/prefer-importing-vitest-globals进口在进口键规则中保持可见
vitest/prefer-to-be-truthy, (中文(简体) ), vitest/prefer-to-be-falsyvitest/prefer-strict-boolean-matcherstoBe(true) 更严格
eslint/no-undefinedunicorn/no-null, (中文(简体) ), unicorn/no-useless-undefined禁止两者 null 财务报告和审定财务报表 undefined 没有办法表达离开
eslint/no-warning-comments—— 说已追踪拒绝 TODO(#123):· ; core/no-dead-comments 只有未跟踪的报告
eslint/max-lines-per-functioneslint/max-statements计数物理行, 因此缩窄的打印宽度会失败; 语句不会
eslint/default-casetypescript/switch-exhaustiveness-checkdefault 隐藏新的工会会员
eslint/require-awaittypescript/require-await键入扩展名
eslint/no-implied-evaltypescript/no-implied-eval键入扩展名
eslint/prefer-promise-reject-errorstypescript/prefer-promise-reject-errors键入扩展名
eslint/no-throw-literaltypescript/only-throw-error键入扩展名
unicorn/prefer-includestypescript/prefer-includes已键入重复
unicorn/prefer-string-starts-ends-withtypescript/prefer-string-starts-ends-with已键入重复
unicorn/prefer-array-findtypescript/prefer-find已键入重复
eslint/no-magic-numbers (仅测试文件)vitest/prefer-expect-assertions预期值为甲骨文并保持文字; expect.assertions(n) 还有

[尖叫声] 键入方获胜的唯一原因是 typeAware: true。 。 。 . 关闭:重新启用无型规则.

模糊测试标题失败

it("works", …)                            // ❌ bare "works" / "should work", any case
it("adds items correctly", …)             // ❌ correctly / properly / as expected
it("rejects improperly signed tokens", …) // ✅
测试文件规则按名称标出,牛林1.82.0 mustNotMatch 探测器

上层的动作不能放弃:

规则拥有
vitest/require-to-throw-message赤线 toThrow() 编号 : rejects.toThrow() (单位:千美元)core/no-weak-test-assertions 跳过这个)
vitest/prefer-called-with赤线 toHaveBeenCalled(): 使现有的交互断言精确, 不创建它们
vitest/valid-titlemustNotMatch: vagueTestTitlePattern
vitest/require-hook顶层设置; allowedFunctionCalls 承认这四点 *Conformance({ root }) 书记官长

是否坚持一个电话: Agentlint core/test-behavior-coverage。 。 。 . toHaveBeenCalledWith(expect.anything())数字 : core/no-weak-test-assertions。 。 。 .

mustNotMatch 表单(克林特1.82.0)火灾?
纯字符串✅
{ it: "<regex>" }✅
[regex, message] 二联✅
任意形式 + 非空 disallowedWords被忽略
样式与 \b 或者说 \W永远不匹配

因此,填充词共享一个模式 [^a-z] 词边. 覆盖:保留一个 mustNotMatch离开 disallowedWords 未设. src/index.test.ts 运行安装的克林特 针对这些案例.

切入层

import {
  defineStrictOxlintConfig,
  layerDirectionOverride,
  withImportGraphLayer,
  withTanstackQueryLayer,
} from "@aurelienbbn/oxlint-config";
import { defineConfig } from "oxlint";

export default defineConfig(
  withImportGraphLayer(
    withTanstackQueryLayer(
      defineStrictOxlintConfig({
        overrides: [
          layerDirectionOverride({
            files: ["**/domain/**"],
            forbidden: ["**/infra/**", "express"],
            message: "Domain never imports infrastructure.",
          }),
        ],
      }),
    ),
  ),
);

已经规定的规则 config 赢得任何一层.

[尖叫声] 克林特取代了规则选项,它不会将它们合并. 两个 overrides 匹配一个文件: 后一个 eslint/no-restricted-imports 胜出,或者替换根级。 每层一个条目,列出它不能到达的一切.

TanStack 查询层: 安装、 探测结果、 相伴插件
pnpm add -D @tanstack/eslint-plugin-query   # not a dependency of this package

将插件添加到 jsPlugins组合 tanstackQueryRules 改为 error。 。 。 .

@tanstack/query/…在探测中报告1
exhaustive-deps✅
mutation-property-order✅
no-rest-destructuring✅(需要牛林下的信息类型吗?) (未经证实)
prefer-query-options✅
stable-query-client✅
infinite-query-property-order未行使
no-unstable-deps未行使
no-void-query-fnQQ出局:需要TS检查器,不接触克林特JS插件

1个 @tanstack/eslint-plugin-query 5.103.1 在克林特1.82.0下,一次性使用. 连接, 未核实的覆盖 : 不重置固定安装正式插件; oxlint JS插件为α. 升级后再次检查 .

options.companionPlugins数字 : { specifier, rules }[]后附的指定者 jsPlugins 正式插件后; 规则在正式规则后合并.

@effect/tsgo 层:安装、版本锁定、所有者规则、已解决的冲突
pnpm add -D @effect/[email protected] [email protected] [email protected] [email protected]   # not dependencies of this package
// package.json: registers the native `effecttsgo` plugin in oxlint-tsgolint
{ "scripts": { "prepare": "effect-tsgo patch --oxlint" } }
// oxlint.config.ts
import { recommended } from "@effect/tsgo/oxlint-presets";
import { defineStrictOxlintConfig, withEffectTsgoLayer } from "@aurelienbbn/oxlint-config";
import { defineConfig } from "oxlint";

export default defineConfig(withEffectTsgoLayer(defineStrictOxlintConfig(), { preset: recommended }));

合并预设规则, 添加 effecttsgo 改为 plugins,则 effectTsgoOwnerRules, (中文(简体) ), effectTsgoSettledRules 财务报告和审定财务报表 effectIdiomRules。配置规则和选项胜出。 预设报告 warn; 严格的预设 denyWarnings 使这些阻塞。 LSP 编辑器 (@effect/language-service 内 tsconfig.json plugins: 设置 "diagnostics": false,或者每个发现显示两次.

[尖叫声] 版本锁. @effect/tsgo 0.45.0支持克克林特 1.81.0 / 1.82.0,克林特-tsgolint 7.0.2001, TypeScript 7.0.2, 并 effect-tsgo patch 拒绝其他一切 这是 兼容性 baseline 行; 键 current 活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活活. 固定基线行 直到 tsgo 释放 扩大其矩阵.

effectTsgoOwnerRules关闭 recommended在这里,因为他们有支票 @aurelienbbn/oxlint-plugin-effect 已删除.

effecttsgo/…拥有删除的规则
any-unknown-in-error-contextno-unsafe-error-channel
unsafe-effect-type-assertionno-effect-type-assertion
deterministic-keysmatching-identifier (与 class-self-mismatch已输入 recommended(中文(简体) )
strict-effect-provide• 部分: Effect.provide 切入点以外, 而不是删除 Layer.provide 筑巢

每一个重叠 @aurelienbbn/oxlint-plugin-effect,一次解决:

effecttsgo/…利用规则设置为什么
catch-die-to-or-dieno-effect-ordieoff它的重写是 Effect.orDie——"哈尼斯规则"禁止的;正在死亡的渔获物已经报告
redundant-or-dieno-effect-ordieoff举起一 orDie harness 规则已经报告
catch-to-or-else-succeedno-swallowed-failureoff重写 Effect.orElseSucceed(() => placeholder) 也报告过
catch-to-ignoreno-swallowed-failure, (中文(简体) ), no-catch-all-causeoff说明赤色 Effect.ignore (需求数) { log })或(或) Effect.ignoreCause (被取缔)
global-fetch, (中文(简体) ), global-fetch-in-effectrequire-abort-signal两个先上,先上替换 fetch 与 HttpClient (中断建入) 两者都安静; 转发 signal 单枪匹马的射击 保存中 fetch: 关上tsgo对
global-error-in-effect-failure, (中文(简体) ), extends-native-errorrequire-tagged-effect-fail都开始相同的固定(标记错误); Effect.fail(new Error(…)) 两次报告。 字词和字符串:只使用
try-catch-in-effect-gen, (中文(简体) ), global-timers-in-effectno-unsafe-effect-bodytsgo 拥有harness规则只保留它 throw 检查

不运行 @aurelienbbn/oxlint-plugin-effect四个 off 规则失去了他们的理由:让他们回到 rules。 。 。 .

effectIdiomRules: 抵触的严格预设规则 @effect/tsgo 或者一个平庸效应的API需要。 效果方胜出; 每项规则仍然报告在平面外 .

严格规则设置为什么
typescript/promise-function-asyncoff它的自定义添加 async,哪个 effecttsgo/async-function 报告
eslint/new-capcapIsNew: false效果构建器是 PascalCase 函数 : Schema.Struct(…)
eslint/func-namesgenerators: "never"Effect.gen(function* () { … }) 使用匿名生成器
node/no-syncignores: ["runSync"]Effect.runSync 在边缘运行效果; fs.*Sync 仍在报告
eslint/max-classes-per-fileoff标记错误, Schema.Class 模型和服务是类;一个域单元有几种
eslint/no-redeclareoffa Schema 及其类型共享名称(const User + 键 type User); TypeScript 拒绝真实的重新声明
unicorn/throw-new-erroroff报告 Schema.TaggedError<Self>()(…) 厂; 其自动固定不编译的代码
typescript/prefer-readonly-parameter-types方法只读, 推断类型被忽略, 效果的不可变类型允许深检查拒绝每个 Effect, (中文(简体) ), Option, (中文(简体) ), DateTime.Utc, (中文(简体) ), Redacted, SQL 组合键 Fragment 财务报告和审定财务报表 Migrator.Loader 参数; 可变阵列和对象仍然报告
unicorn/no-array-callback-reference, (中文(简体) ), unicorn/no-array-for-each, (中文(简体) ), unicorn/no-array-method-this-argument, (中文(简体) ), unicorn/no-array-sortoff带有命名空间的导入 Option.some(value), (中文(简体) ), Effect.forEach, (中文(简体) ), Arr.filter(xs, f), (中文(简体) ), Arr.sort(order); 计 数 effect/no-array-* 规则 @aurelienbbn/oxlint-plugin-effect 报告真实数组的相同误用。 不运行该插件: 将四个放回 rules

信用:预设形状 effecttsgo 插件名, 每个诊断名来自 效应-TS/tsgo (麻省理工学院).

图层方向: 字段

一个 overrides 使用条目 eslint/no-restricted-imports patterns。 。 。 . 没有默认图层 : 没有层次,没有规则.

外地带
files被保护层的阴影
forbiddengitignore 风格的光滑表示路径, 空名表示包; 相对和包导入两个报告
message固定方向: 规则无法知道这三招中的哪一是正确的
导入图层: 为什么选入, 升级清单

循环在兄弟姐妹间通过方便进口而逐渐形成,然后表面形成 undefined 在模块内和不可测试模块中.

import rules in oxlint 1.82.0   33
  error  ██                      2   import/no-cycle, import/no-self-import
  off    ███████████████████████ 31  pinned off in importGraphRules

正在装入 import 插件还构建模块图形,这样可以 oxc/no-barrel-file 计算一个桶的负载:一个包 src/index.ts 超过效果模块装入了数百个。 通过其入境点为: entrypoints (单位:千美元)withImportGraphLayer(config, { entrypoints: ["packages/*/src/index.ts"] })豁免他们.

添加中 "import" 改为 plugins 单独开关,涵盖所有33个类别,包括相矛盾的对: import/no-default-export 对 import/prefer-default-export, (中文(简体) ), import/no-named-export, (中文(简体) ), import/group-exports。想要另一个:设置它 rules。 。 。 .

行为细节
只类型循环被忽视(ignoreTypes: 运行时消失
费用解决整个项目的文件, 插件最昂贵的规则
路径别名只在牛林找到声明的 tsconfig 时解决

每次牛林升级后,一个新的 import/* 规则缺失 importGraphRules 通过它的类别打开:

  • pnpm exec oxlint --rules (或 --rules -f json(中文(简体) )
  • 比较 import 行为 importGraphRules
  • 标出每个新规则 off

给 src/index.test.ts 在列表与已安装的克林特匹配之前失败 。 消费者在另一个牛林检查手.

合同和迁移

专题合同
目标节点/TypeScript. 浏览器: 覆盖 env.node,启用浏览器环境
托儿所关闭等待升级审查,但 typescript/no-unnecessary-condition
命名空间禁用已删除
列表plugins, (中文(简体) ), jsPlugins, (中文(简体) ), ignorePatterns, (中文(简体) ), overrides 合并; { replaceLists: true } 替换您提供的任何列表
对象categories, (中文(简体) ), env, (中文(简体) ), options, (中文(简体) ), rules, (中文(简体) ), settings 按密钥合并
隔离嵌入规则选项是独立的克隆
类型从 oxlint; Vite+ 再出口同一合同
兼容性矩阵 测试基线上的已装入的配置和包括型号在内的当前跑道

版本与发布记录

@aurelienbbn/oxlint-config 共发布 8 个版本,首次发布于 2026/09/25;过去 12 个月发布了 8 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.8.0latest2026/09/301 个月前
0.6.02026/09/291 个月前
0.5.02026/09/291 个月前
0.4.02026/09/291 个月前
0.3.02026/09/281 个月前
0.2.02026/09/281 个月前

关于 @aurelienbbn/oxlint-config 的常见问题

@aurelienbbn/oxlint-config 是什么?

对TypeScript项目有意见的严格可再使用的克林特配置.

如何安装 @aurelienbbn/oxlint-config?

在项目目录运行 npm install @aurelienbbn/oxlint-config,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:oxlint(>=1.82.0 <2.0.0)、oxlint-tsgolint(^7.0.2001)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@aurelienbbn/oxlint-config 支持 TypeScript 吗?

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

@aurelienbbn/oxlint-config 支持 ESM 还是 CommonJS?

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

@aurelienbbn/oxlint-config 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js ^22.19.0 || ^24.11.0。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@aurelienbbn/oxlint-config 可以商用吗?

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

@aurelienbbn/oxlint-config 的下载量有多少?

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

@aurelienbbn/oxlint-config 还在维护吗?

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