Skip to main content
New aislop v0.13.1 patch — calibrates hidden-fallback detection and fixes regex comment-masker false positives. Read the changelog →
ai-slop/thin-wrapper manual fix

Thin wrapper.

A function that exists only to call another function with the same arguments — no transformation, no added value, just an extra layer.

Flagged shape and clean shape.

Each example shows the exact code shape the rule is looking for, then the smallest version that keeps the intent without hiding risk or adding noise.

Flagged example
// users.ts
export function getUser(id: string) {
  return userService.getUser(id)
}

// profile.ts
import { getUser } from './some/file'
const user = await getUser(id)
Why this trips

Deterministic AST match: flags functions whose body only forwards their parameters unchanged to another call.

Clean example
// profile.ts
import { userService } from './services/user-service'

const user = await userService.getUser(id)
What changed

Delete pass-through wrappers and call the real function directly. Keep a wrapper only when it adapts an interface, adds behavior, or names a stable boundary that multiple callers rely on.

Agents introduce wrappers preemptively "in case we need to extend it later". They never need to. The wrapper hides the actual call, doubles the import surface, and adds zero value.

How this rule is justified.

Rule id

ai-slop/thin-wrapper

Enforcing engine

ai-slop

Detector strategy

Deterministic AST match: flags functions whose body only forwards their parameters unchanged to another call.

Legitimate code that is NOT flagged

Wrappers that transform arguments, add error handling, adapt interfaces, or exist for a documented seam are not flagged.

Evidence

Provenance: repeated across public scans as a speculative indirection layer.