Anti-Slop
Rules to prevent common LLM slop. Ported from dmmulroy/anti-slop. Browse all 15 rules in this category.
Showing 15 rules
No Chained Type Assertions
Anti-Slopno-chained-type-assertionsDisallow chained TypeScript as and angle-bracket assertions, including parenthesized chains.
- Problem
No Conditional Empty Object Spread
Anti-Slopno-conditional-empty-object-spreadDisallow object spreads that conditionally spread an empty object to omit fields.
- Suggestion
No Known Value Widening
Anti-Slopno-known-value-wideningDisallow syntactically established values from flowing into explicitly broad or anonymous target types that discard useful evidence.
- Problem
No Module Mocking
Anti-Slopno-module-mockingDisallow Vitest and Jest module mocking; tests must replace dependencies through real interfaces.
- Problem
No Object Parameters
Anti-Slopno-object-parametersDisallow object function parameters; inputs must use an owner-provided type and be parsed at their boundary.
- Problem
No Reflect Apply
Anti-Slopno-reflect-applyDisallow Reflect.apply; call typed functions directly or model dynamic dispatch behind an interface.
- Problem
No Reflect Get
Anti-Slopno-reflect-getDisallow Reflect.get; use typed property access or parse dynamic input into a domain type.
- Problem
No Runtime Typeof
Anti-Slopno-runtime-typeofDisallow runtime typeof checks; external values must be decoded into meaningful types at their I/O boundary.
- Problem
No Shape In Symbol Names
Anti-Slopno-shape-in-symbol-namesDisallow the case-insensitive substring "shape" in JavaScript, TypeScript, private, and JSX symbol names.
- Problem
No Unknown Parameters
Anti-Slopno-unknown-parametersDisallow 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
Anti-Slopno-unknown-returnsDisallow functions whose explicit return contract is unknown or Promise<unknown>.
- Problem
No Unknown Type Aliases
Anti-Slopno-unknown-type-aliasesDisallow type aliases whose resolved type is unknown; unknown must remain visible at an allowed boundary.
- Problem
No Unsafe Dictionary Type
Anti-Slopno-unsafe-dictionary-typeDisallow 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
Anti-Slopno-widen-then-assertDisallow 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
Anti-Sloprequire-safety-comment-for-type-assertionRequire a nearby SAFETY comment (or a described Oxlint suppression of typescript/no-unsafe-type-assertion) for every TypeScript type assertion except const assertions.
- Problem