# @aranlucas/oxlint-plugin-anti-slop 中文文档

规范地址：https://npmcn.com/package/%40aranlucas/oxlint-plugin-anti-slop/

版本：0\.1\.1
npm 元数据更新时间：2026-10-23T20:04:16.174Z
中文译文更新时间：2026-11-08T06:19:19.305Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40aranlucas/oxlint-plugin-anti-slop
原文对照：https://npmcn.com/package/%40aranlucas/oxlint-plugin-anti-slop/?lang=original
项目主页：https://github.com/aranlucas/oxlint-plugin-anti-slop#readme
源码仓库：https://github.com/aranlucas/oxlint-plugin-anti-slop

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：160 kB，65 个文件
- 模块格式：ES Module
- TypeScript 类型：包内自带
- Node.js 要求：\>=22\.18\.0
- 运行依赖：1 个
- peer 依赖：oxlint \>=1\.78\.0
- 首次发布：2026-10-13T15:53:43.868Z
- 最新版本发布：2026-10-23T20:04:15.672Z
- 近 30 天下载量：1882（2026-10-07 至 2026-11-05，npm 官方下载统计）
- 已发布版本数：3（近 12 个月 3 个）

## 中文简介

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

## 安装

```sh
npm install @aranlucas/oxlint-plugin-anti-slop
```

也可以使用：`pnpm add @aranlucas/oxlint-plugin-anti-slop`、`yarn add @aranlucas/oxlint-plugin-anti-slop`、`bun add @aranlucas/oxlint-plugin-anti-slop`

## README

# @aranlucas/oxlint-plugin-反斜坡

意见 [氧化剂](https://oxc.rs/docs/guide/usage/linter/js-plugins) 规则拒绝低证据 TypeScript 和 JavaScript 模式,为 npm 包装.

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

## 安装

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

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

## 配置

`.oxlintrc.json`数字 :

```jsonc
{
  "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平面配置:

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

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

## 开发

```bash
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 是什么？

有观点认为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 和提交记录判断。

