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"—low-signal, low-evidence, or inefficient coding patterns. It aims to enforce higher code quality and stricter type safety by rejecting patterns that discard type information or use inefficient runtime operations.
How it works
It is a plugin for Oxlint, using Oxlint's ESTree and lexical-scope APIs to analyze code syntactically. The project is designed to be "vendored," meaning users copy the rules directly into their own repositories rather than installing it as a fixed npm dependency, allowing teams to customize the rules to their own standards.
It can be installed via an agent skill (using npx skills add) which automates the copying, configuration, and dependency management, or manually by copying the src/ directory and registering the plugin in oxlint.config.ts.
Who it’s for
TypeScript and JavaScript developers who want a stricter, more opinionated linting standard to reduce boilerplate, prevent common type-widening mistakes, and enforce better architectural patterns (particularly for those using the Effect ecosystem).
Highlights
- Type Safety Enforcement: Rejects "widening" known values to
unknownorobjectand forbids chained type assertions. - Efficiency Checks: Flags adjacent eager
filter().map()calls in favor of lazy iterator pipelines and prevents quadratic complexity inreduceaccumulators. - Effect Ecosystem Support: Includes a dedicated rule group for the Effect library to prevent manual tag comparisons and encourage the use of the
MatchAPI. - require-safety-comment: Forces developers to provide a
// SAFETY:justification comment for every non-const type assertion. - Agent-Ready Installation: Provides a bundled skill to help AI coding agents automate the setup and update process.
Related
- Project
- Dispatch
- Project
- Project