Deslop 是一个开源工具项目,基于 Oxlint 框架为 TypeScript 提供专门的代码检查规则集,用于识别和拒绝 AI 生成的低质量代码模式1。该工具可通过 npm 安装使用,命令为 npm install --save-dev ai-deslop,并支持 Node.js、Bun 和 Deno 三种运行时环境1。
Deslop 包含共 21 条规则,其中包括 12 条针对类型安全的规则(如 no-chained-type-assertions、no-unknown-parameters 等)、5 条通用规则(如 no-array-filter-map、no-reflect-apply 等)和 4 条测试相关规则(如 no-call-only-assertions、no-module-mocking 等),此外还提供 4 条可选规则(如 no-duplicate-consts、canonical-class-names 等)1。项目依赖 @oxlint/plugins,需与 oxlint 版本保持同步,采用 MIT 许可证,部分规则来自 dmmulroy/anti-slop 项目1。
Deslop is an open-source linting tool built on Oxlint that helps developers identify and reject low-quality code patterns typically produced by artificial intelligence systems in TypeScript projects.1 The tool can be installed via npm using the command npm install --save-dev ai-deslop and is distributed under an MIT license, incorporating rules originally from the dmmulroy/anti-slop project.1
The ruleset comprises 21 core rules organized into three categories: 12 type-safety focused rules including no-chained-type-assertions and no-unknown-parameters, 5 general-purpose rules such as no-array-filter-map and no-reflect-apply, and 4 test-related rules like no-call-only-assertions and no-module-mocking.1 Additionally, the tool offers 4 optional rules covering duplicate constants and canonical class naming conventions.1 Deslop requires synchronization with the Oxlint version and depends on the @oxlint/plugins package.1 The tool supports execution across multiple JavaScript runtimes, including Node.js, Bun, and Deno.1
评论
还没有评论,欢迎留下第一条。