anti-slop
dmmulroy · dmmulroy/anti-slop
Provides opinionated Oxlint rules for TypeScript/JavaScript to reject low-evidence patterns, installable and configurable by AI coding agents.
Opinionated Oxlint rules for rejecting low-evidence TypeScript and JavaScript patterns
Preview
What you can do with it
- Configure an AI agent to automatically apply opinionated linting rules to a new project.
- Update existing anti-slop rules in a repository while preserving local customizations.
- Ensure new code adheres to specific TypeScript/JavaScript quality standards enforced by an agent.
Safety check
No risky patterns found in the files we scanned.
Automated scan of the repo files. Always review code you run.
From the README
anti-slop
Opinionated Oxlint rules that reject low-evidence and low-signal TypeScript and JavaScript patterns.
Anti-slop is first and foremost the ruleset I use with my work, projects, and team. It reflects my preferences and taste rather than attempting to be a universal coding standard.
This project is meant to be vendored, not treated as a fixed npm dependency. There is no official npm package. Copy the rules into your repository, read them, and change them to match your team's standards. The bundled agent skill handles the initial copy and configuration; after that, the vendored files are yours to maintain and make your own. Community-maintained forks and packages are welcome, but their compatibility and release lifecycle belong to their maintainers.
Install with an agent skill
npx skills add dmmulroy/anti-slop --skill install-anti-slop
Then ask your coding agent to install or configure anti-slop in the current repository. The skill copies the plugin, installs compatible Oxlint dependencies—matching an existing Oxlint version when present—merges the plugin into the existing lint configuration, enables every generic rule, and validates the result. In repositories that depend directly on Effect, it also enables the opt-in Effect rule group.
Update an existing installation
Ask your agent to update anti-slop while preserving local customizations, optionally naming an upstream revision or selected fixes. The same skill stages incoming source separately, uses a three-way merge when the original upstream snapshot is recoverable, and otherwise ports reviewed changes conservatively. It preserves local rules and configuration, asks about conflicting policy and enabling new rules, and records provenance for future updates. It does not force-replace the vendored directory.
For latest upstream, ask the agent to retrieve and identify that revision; an already-installed skill bundle may be older. The copy script itself does not fetch or merge updates.
To inspect available skills first:
npx skills add dmmulroy/anti-slop --list
Manual local installation
Copy src/ into the target repository, for example at tools/oxlint/anti-slop/. If the repository already uses oxlint, install @oxlint/plugins at exactly the resolved Oxlint version. Otherwise, install the same current version of both packages. Keep both versions exact so upgrades move them together.
Register the copied entry point in oxlint.config.ts:
import { defineConfig } from "oxlint";
export default defineConfig({
ignorePatterns: [
".agent/**",
".agents/**",
".claude/**",
".codex/**",
".continue/**",
".cursor/**",
".gemini/**",
".opencode/**",
".pi/**",
".roo/**",
".windsurf/**",
"tools/oxlint/anti-slop/**",
],
jsPlugins: [
{ name: "anti-slop", specifier: "./tools/oxlint/anti-slop/index.ts" },
],
rules: {
"oxc/no-accumulating-spread": "error",
"anti-slop/no-array-filter-map": "error",
"anti-slop/no-reduce-accumulator-copy": "error",
"anti-slop/no-chained-type-assertions": "error",
"anti-slop/no-conditional-empty-object-spread": "error",
"anti-slop/no-known-value-widening": "error",
"anti-slop/no-module-mocking": "error",
"anti-slop/no-object-parameters": "error",
"anti-slop/no-reflect-apply": "error",
"anti-slop/no-reflect-get": "error",
"anti-slop/no-runtime-typeof": "error",
"anti-slop/no-shape-in-symbol-names": "error",
"anti-slop/no-unknown-parameters": "error",
"anti-slop/no-unknown-returns": "error",
"anti-slop/no-unknown-type-aliases": "error",
"anti-slop/no-unsafe-dictionary-type": "error",
"anti-slop/no-widen-then-assert": "error",
"anti-slop/require-readable-spacing": "error",
"anti-slop/require-safety-comment-for-type-assertion": "error"
}
});
The same ignorePatterns, jsPlugins, and rules work under lint in a Vite+ config. Merge the ignore patterns into Vite+'s fmt.ignorePatterns as well so vp check does not reformat installed agent assets or the vendored plugin. Preserve existing ignores and add any other project-local agent tooling directories detected in the repository; do not broadly ignore every dot-directory.
Optional Effect rules
Effect-specific rules live in a separate plugin so projects that do not use Effect do not inherit Effect architecture policy. Register the Effect entry point only in repositories that use Effect:
export default defineConfig({
jsPlugins: [
{ name: "anti-slop", specifier: "./tools/oxlint/anti-slop/index.ts" },
{
name: "anti-slop-effect",
specifier: "./tools/oxlint/anti-slop/effect/index.ts"
}
],
rules: {
"anti-slop-effect/no-manual-effect-error-tag": "error",
"anti-slop-effect/no-manual-tag-comparison": "error",
"anti-slop-effect/no-manual-tagged-construction": "error",
"anti-slop-effect/no-service-constructor-imports": "error",
"anti-slop-effect/prefer-effect-match": "error"
}
});
Rules
Generic rules
no-array-filter-map— rejects adjacent eager array filter/map passes while allowing lazy iterator pipelines.no-reduce-accumulator-copy— rejects non-spread accumulator copies inside reducers; complements nativeoxc/no-accumulating-spread.no-chained-type-assertions— rejects nestedasand angle-bracket assertions that fabricate evidence; chains made only ofas constremain valid.no-conditional-empty-object-spread— reports object spreads that use a conditional{}branch to omit fields. It intentionally has no autofix because omission is not equivalent to assigningundefined.no-known-value-widening— rejects known expressions flowing into explicitunknown,object, anonymous-object, or open-dictionary targets, including known arguments passed to localunknowntype predicates. Empty dictionary accumulators and finite-keyRecordtargets remain valid.- `no-module-mocki