dmmulroy/anti-slop

Opinionated Oxlint rules for rejecting low-evidence TypeScript and JavaScript patterns

What it solves

Anti-slop provides a set of opinionated linting rules for TypeScript and JavaScript to eliminate "slop"—coding patterns that provide low evidence or low signal. It aims to enforce higher type safety and stricter architectural boundaries by rejecting patterns that fabricate evidence (like chained type assertions) or discard type information (like widening known values to unknown).

How it works

It is implemented as a plugin for Oxlint, using Oxlint's ESTree and lexical-scope APIs to analyze code. Rather than relying on a TypeScript type checker, it resolves same-file aliases and transparent generic aliases to identify violations. The project is designed to be vendored (copied directly into a repository) rather than installed as a fixed dependency, allowing teams to customize the rules to their own standards.

Who it’s for

Developers and teams working with TypeScript and JavaScript who want to enforce strict type-safety standards and avoid common low-signal patterns in their codebase.

Highlights

  • Strict Type Evidence: Rejects chained type assertions and widening of known values to unknown or object.
  • Boundary Enforcement: Requires boundary parsing instead of ad hoc typeof narrowing and rejects unknown in function parameters and returns.
  • Safety Justifications: Forces developers to provide a SAFETY comment (or a custom marker) to justify non-const type assertions.
  • Effect Integration: Includes a specialized rule group for projects using the Effect framework to prevent improper service constructor imports.
  • Agent-Ready Installation: Provides a bundled agent skill to automate the initial copying and configuration of the rules into a project.

Related

  • Project