Skip to content

Anti-Slop

Rules to prevent common LLM slop. Ported from dmmulroy/anti-slop. Browse all 16 rules in this category.

Showing 16 rules

No Chained Type Assertions

no-chained-type-assertions

Disallow chained TypeScript as and angle-bracket assertions, including parenthesized chains.

  • Problem

No Conditional Empty Object Spread

no-conditional-empty-object-spread

Disallow object spreads that conditionally spread an empty object to omit fields.

  • Suggestion

No Known Value Widening

no-known-value-widening

Disallow syntactically established values from flowing into explicitly broad or anonymous target types that discard useful evidence.

  • Problem

No Module Mocking

no-module-mocking

Disallow Vitest and Jest module mocking; tests must replace dependencies through real interfaces.

  • Problem

No Object Parameters

no-object-parameters

Disallow object function parameters; inputs must use an owner-provided type and be parsed at their boundary.

  • Problem

No Reduce Accumulator Copy

no-reduce-accumulator-copy

Disallow copying growing reducer accumulators with Object.assign, Array.from, or array copy methods.

  • Problem

No Reflect Apply

no-reflect-apply

Disallow Reflect.apply; call typed functions directly or model dynamic dispatch behind an interface.

  • Problem

No Reflect Get

no-reflect-get

Disallow Reflect.get; use typed property access or parse dynamic input into a domain type.

  • Problem

No Runtime Typeof

no-runtime-typeof

Disallow runtime typeof checks; external values must be decoded into meaningful types at their I/O boundary.

  • Problem

No Shape In Symbol Names

no-shape-in-symbol-names

Disallow the case-insensitive substring "shape" in JavaScript, TypeScript, private, and JSX symbol names.

  • Problem

No Unknown Parameters

no-unknown-parameters

Disallow explicitly unknown function parameters except `cause` and the parameter named by a type predicate; decode unknown input at its I/O boundary instead.

  • Problem

No Unknown Returns

no-unknown-returns

Disallow functions whose explicit return contract is unknown or Promise<unknown>.

  • Problem

No Unknown Type Aliases

no-unknown-type-aliases

Disallow type aliases whose resolved type is unknown; unknown must remain visible at an allowed boundary.

  • Problem

No Unsafe Dictionary Type

no-unsafe-dictionary-type

Disallow object-dictionary contracts whose direct value type is unknown, any, object, {}, or a union/alias containing one of those escape hatches.

  • Problem

No Widen Then Assert

no-widen-then-assert

Disallow local const flows that explicitly widen a known value before asserting the widened binding to a narrower type.

  • Problem

Require Safety Comment For Type Assertion

require-safety-comment-for-type-assertion

Require a nearby safety-marker comment (or a described Oxlint suppression of typescript/no-unsafe-type-assertion) for every TypeScript type assertion except const assertions.

  • Problem