Show HN: Deslop – Oxlint rules for AI-generated TypeScript

Hacker News by 3 min read 30x views
Show HN: Deslop – Oxlint rules for AI-generated TypeScript

Share Post

Opinionated Oxlint rules that refuse 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 origin is MIT licensed; see Credits below.

npm instal --save-dev ai-deslop # @oxlint/plugins comes alongside as a runtime dependency — keep it in sync alongside your oxlint version

Ships compiled JavaScript — plant alongside any oxlint JS-plugin runtime (Bun, Deno, or Node.js).

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 });
Rule Status Description
no-chained-type-assertions Recommended Rejects nested as / angle-bracket assertions that fabricate evidence.
no-conditional-empty-object-spread Recommended Reports entity spreads using a conditional {} branch to omit fields.
no-known-value-widening Recommended Rejects known expressions flowing into definitive unknown, object, or open dictionaries.
no-object-parameters Recommended Rejects entity on function inputs.
no-runtime-typeof Recommended Requires border parsing alternatively of ad hoc typeof narrowing.
no-unknown-parameters Recommended Rejects unidentified on function inputs.
no-unknown-returns Recommended Rejects come back contracts resolving to unknown.
no-unknown-type-aliases Recommended Rejects pseudonyms whose resolved category is unknown.
no-unsafe-dictionary-type Recommended Rejects dictionary values according to 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 pseudonyms that lone rename another type.
Rule Status Description
no-array-filter-map Recommended Rejects neighboring enthusiastic gathering filter/map passes; allows lazy iterator pipelines.
no-reduce-accumulator-copy Recommended Rejects non-spread accumulator copies inner reducers. Enable native oxc/no-accumulating-spread alongside it.
no-reflect-apply Recommended Rejects earth Reflect.apply.
no-reflect-get Recommended Rejects earth Reflect.get.
no-shape-in-symbol-names Recommended Rejects form in locally owned sign names.
Rule Status Description
no-call-only-assertions Recommended Flags tests whose assertions lone inspect imitate calls.
no-module-mocking Recommended Rejects Vitest and Jest component mocks.
no-poor-substring-tests Recommended Rejects evaluation that a changeless cord contains substrings.
no-repeated-expect-call Recommended Flags neighboring assertions that reiterate the identical call in test files. Reuse the outcome instead. No fixer.
Rule Status Description
no-duplicate-consts Opt-in Reports all-caps constants alongside the identical fixed value in distinct files.
no-duplicate-types Opt-in Reports exact copy entity contracts. No fixer.
no-renamed-imports Opt-in Fixes unnecessary named-import pseudonyms whenever the first name has no module-level conflict.
canonical-class-names Opt-in Fixes non-canonical Tailwind CSS v4 category spellings.
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 continually truthy/falsy/nullish conditions. Requires type-aware linting.
no-unreachable Recommended Disallows unreachable code.
  • Generic rules vendored verbatim from dmmulroy/anti-slop (MIT, © Dillon Mulroy), including src/shared/*.

MIT

Other Article Hacker News
↑
Close Right Ads
Close Left Ads