@aranlucas/oxlint-plugin-anti-slop

中文文档
0.1.1发布于 2026/10/24MITTypeScriptES Module构建来源已验证近 30 天下载 1882

有观点认为Oxlint规则拒绝低证据TypeScript和JavaScript模式. 被包装为dmmulroy/反斜口.

中文使用文档
文档目录6 节
  1. 安装
  2. 配置
  3. ESLint 语录
  4. 开发
  5. 释放
  6. 许可证

@aranlucas/oxlint-plugin-反斜坡

意见 氧化剂 规则拒绝低证据 TypeScript 和 JavaScript 模式,为 npm 包装.

这是出版的叉子 dmmulroy/反斜坡。上游意在复制到每个仓库。 这个软件包将同样的规则编译为JavaScript,这样每个repo就可以安装一个版本的依赖性. 见 (原始内容存档于2012-10-12). UPSTREAM.md 上层的承诺和当地的变化。 规则文件和实例载于 上游读取。 。 。 .

安装

pnpm add -D oxlint @aranlucas/oxlint-plugin-anti-slop

要求数 oxlint 1.78或更新和节点22.18或更新.

配置

.oxlintrc.json数字 :

{
  "jsPlugins": [{ "name": "anti-slop", "specifier": "@aranlucas/oxlint-plugin-anti-slop" }],
  "rules": {
    "oxc/no-accumulating-spread": "error",
    "anti-slop/no-array-filter-map": "error",
    "anti-slop/no-reduce-accumulator-copy": "error",
    "anti-slop/no-chained-type-assertions": "error",
    "anti-slop/no-conditional-empty-object-spread": "error",
    "anti-slop/no-known-value-widening": "error",
    "anti-slop/no-module-mocking": "error",
    "anti-slop/no-object-parameters": "error",
    "anti-slop/no-reflect-apply": "error",
    "anti-slop/no-reflect-get": "error",
    "anti-slop/no-runtime-typeof": "error",
    "anti-slop/no-shape-in-symbol-names": "error",
    "anti-slop/no-unknown-parameters": "error",
    "anti-slop/no-unknown-returns": "error",
    "anti-slop/no-unknown-type-aliases": "error",
    "anti-slop/no-unsafe-dictionary-type": "error",
    "anti-slop/no-widen-then-assert": "error",
    "anti-slop/require-readable-spacing": "error",
    "anti-slop/require-safety-comment-for-type-assertion": "error",
  },
}

一样 jsPlugins 财务报告和审定财务报表 rules 下潜 lint 在一个 oxlint.config.ts 或作Vite+配置.

require-readable-spacing 将连续的单行装订放在任何范围内,包括出口装订。 带有自己领先评论的绑定开始一个新的组. 多行绑定和控制-流边界接收空白行;已存在的空白行被保留.

ESLint 语录

插件被包起来 eslintCompatPlugin,因此它们也会装入ESLint平面配置:

import antiSlop from "@aranlucas/oxlint-plugin-anti-slop";

export default [
  { plugins: { "anti-slop": antiSlop }, rules: { "anti-slop/no-reflect-get": "error" } },
];

开发

pnpm install
pnpm check   # lint, typecheck, Vitest/RuleTester suites, build, dist smoke test

释放

弹出 version 内 package.json,然后创建标记的 GitHub 释放 vX.Y.Z。发布工作流程以出处发布到 npm.

许可证

麻省理工学院. 原始规则 狄伦·穆罗伊 销售商ESLint Stylistic 代码将自己的执照保存在 src/vendor/eslint-stylistic/LICENSE。 。 。 .

测试通过维特. pnpm test:watch 在开发期间重新运行规则测试器和本地CLI案例; pnpm test:dist 继续单独检查编译的软件包.

版本与发布记录

@aranlucas/oxlint-plugin-anti-slop 共发布 3 个版本,首次发布于 2026/10/13;过去 12 个月发布了 3 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.1.1latest2026/10/2415 天前
0.1.02026/10/1325 天前
0.0.0-stage2026/10/1325 天前

关于 @aranlucas/oxlint-plugin-anti-slop 的常见问题

@aranlucas/oxlint-plugin-anti-slop 是什么?

有观点认为Oxlint规则拒绝低证据TypeScript和JavaScript模式. 被包装为dmmulroy/反斜口.

如何安装 @aranlucas/oxlint-plugin-anti-slop?

在项目目录运行 npm install @aranlucas/oxlint-plugin-anti-slop,或使用 pnpm add / yarn add / bun add。

@aranlucas/oxlint-plugin-anti-slop 支持 TypeScript 吗?

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

@aranlucas/oxlint-plugin-anti-slop 支持 ESM 还是 CommonJS?

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

@aranlucas/oxlint-plugin-anti-slop 需要什么版本的 Node.js?

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

@aranlucas/oxlint-plugin-anti-slop 可以商用吗?

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

@aranlucas/oxlint-plugin-anti-slop 的下载量有多少?

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

@aranlucas/oxlint-plugin-anti-slop 还在维护吗?

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