Show HN: Deslop – Oxlint rules for AI-generated TypeScript
Summary
Deslop 是一套面向 Oxlint 的开源插件规则集,用于拦截 AI 生成的 TypeScript 代码中常见的类型断言滥用、低信号测试等'slop'模式。
View Cached Full Text
Cached at: 10/13/26, 06:58 PM
maharshi365/deslop
Source: https://github.com/maharshi365/deslop
ai-deslop
Opinionated Oxlint rules that reject low-evidence, low-signal, AI-slop code patterns.
Rules are vendored from dmmulroy/anti-slop (generic rules) alongside additional deslop rules, all renamed under the deslop/* namespace. The vendored source is MIT licensed; see Credits below.
Install
npm install --save-dev ai-deslop
# @oxlint/plugins comes along as a runtime dependency — keep it in sync with your oxlint version
Ships compiled JavaScript — works with any oxlint JS-plugin runtime (Bun, Deno, or Node.js).
Usage
import { defineConfig } from "oxlint";
import { configs as deslopConfigs } from "ai-deslop";
export default defineConfig({
jsPlugins: ["ai-deslop"],
options: deslopConfigs.recommended.options,
rules: deslopConfigs.recommended.rules
});
Rules
Type safety and evidence
| Rule | Status | Description |
|---|---|---|
no-chained-type-assertions | Recommended | Rejects nested as / angle-bracket assertions that fabricate evidence. |
no-conditional-empty-object-spread | Recommended | Reports object spreads using a conditional {} branch to omit fields. |
no-known-value-widening | Recommended | Rejects known expressions flowing into explicit unknown, object, or open dictionaries. |
no-object-parameters | Recommended | Rejects object on function inputs. |
no-runtime-typeof | Recommended | Requires boundary parsing instead of ad hoc typeof narrowing. |
no-unknown-parameters | Recommended | Rejects unknown on function inputs. |
no-unknown-returns | Recommended | Rejects return contracts resolving to unknown. |
no-unknown-type-aliases | Recommended | Rejects aliases whose resolved type is unknown. |
no-unsafe-dictionary-type | Recommended | Rejects dictionary values based on unsafe escape hatches. |
no-widen-then-assert | Recommended | Rejects widening known evidence before narrowing assertions. |
require-safety-comment-for-type-assertion | Recommended | Requires an invariant justification for non-const assertions. |
no-pass-through-type-alias | Recommended | Disallows aliases that only rename another type. |
Code quality and APIs
| Rule | Status | Description |
|---|---|---|
no-array-filter-map | Recommended | Rejects adjacent eager array filter/map passes; allows lazy iterator pipelines. |
no-reduce-accumulator-copy | Recommended | Rejects non-spread accumulator copies inside reducers. Enable native oxc/no-accumulating-spread alongside it. |
no-reflect-apply | Recommended | Rejects global Reflect.apply. |
no-reflect-get | Recommended | Rejects global Reflect.get. |
no-shape-in-symbol-names | Recommended | Rejects shape in locally owned symbol names. |
Tests
| Rule | Status | Description |
|---|---|---|
no-call-only-assertions | Recommended | Flags tests whose assertions only check mock calls. |
no-module-mocking | Recommended | Rejects Vitest and Jest module mocks. |
no-poor-substring-tests | Recommended | Rejects testing that a constant string contains substrings. |
no-repeated-expect-call | Recommended | Flags adjacent assertions that repeat the same call in test files. Reuse the result instead. No fixer. |
Opt-in rules
| Rule | Status | Description |
|---|---|---|
no-duplicate-consts | Opt-in | Reports all-caps constants with the same static value in different files. |
no-duplicate-types | Opt-in | Reports exact duplicate object contracts. No fixer. |
no-renamed-imports | Opt-in | Fixes unnecessary named-import aliases when the original name has no module-level conflict. |
canonical-class-names | Opt-in | Fixes non-canonical Tailwind CSS v4 class spellings. |
Standard rules enabled by the recommended config
| Standard rule | Status | Description |
|---|---|---|
typescript/no-deprecated | Recommended | Disallows using code marked @deprecated. Requires type-aware linting. |
typescript/no-require-imports | Recommended | Disallows CommonJS require() imports. |
typescript/no-floating-promises | Recommended | Disallows floating promises. Requires type-aware linting. |
typescript/no-unnecessary-condition | Recommended | Disallows always truthy/falsy/nullish conditions. Requires type-aware linting. |
no-unreachable | Recommended | Disallows unreachable code. |
Guides
| Guide | Contents |
|---|---|
| No duplicate consts | Configuration and exact static-value comparison behavior. |
| No duplicate types | Exact comparison behavior, worker scope, complete TypeScript/JSON examples, and every supported option. |
| No renamed imports | When named-import aliases are fixed and how conflicts are handled. |
| Tailwind canonical class names | Tailwind v4 setup, complete TypeScript/JSON examples, and every supported option. |
Credits
- Generic rules vendored verbatim from dmmulroy/anti-slop (MIT, © Dillon Mulroy), including
src/shared/*.
License
MIT
Similar Articles
@trendtech33566: Is the UI you had AI generate looking exactly the same again? anti-slop, about 5k. A "de-mass-produced" rule set for AI…
The open-source project anti-slop offers a rule set (around 5k stars) for AI coding agents that suppresses the cookie-cutter patterns, hollow marketing copy, and fabricated data common in AI-generated interfaces — without restricting colors or fonts, so developers keep control of their own design direction.
@mattpocockuk: This is really smart. There are definitely a set of rules that are too complex to lint deterministically that feel wast…
The tweet discusses using Jev as a fuzzy linter to handle complex coding guidelines that are not suitable for deterministic linting, with examples like useEffect and comment management.
hardikpandya/stop-slop
A skill/tool for removing common AI writing patterns from prose, including banned phrases, structural clichés, and sentence-level issues, intended for use with Claude or any LLM.
@nateberkopec: Automatic linter rules that are draconian for humans but effective for agents: 1. Cyclomatic complexity budget 2. LOC-p…
The tweet discusses automatic linter rules like cyclomatic complexity budgets and CSS/JS restrictions that are strict for humans but effective for coding agents, with Sam Saffron highlighting their role in preventing long-term code rot.
@IfanJew: https://github.com/hyhmrright/brooks-lint… Very very good! It tries to avoid the problem of AI generating crap code. I don't understand why it has so few stars. It's way better than those other exaggerated skills.
brooks-lint is an AI code review tool based on twelve classic software engineering books, providing structured, traceable code regression risk assessment and repair suggestions, aiming to avoid quality issues in AI-generated code.