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/empty-function manual fix

Empty function.

A function with no body — usually a placeholder the agent stubbed to make a signature compile and forgot to fill in.

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
function handleSubmit(values: FormValues) {
}

export function Form() {
  return <form onSubmit={handleSubmit}>...</form>
}
Why this trips

Deterministic AST match: flags function bodies that contain no statements.

Clean example
function handleSubmit(values: FormValues) {
  return saveDraft(values)
}

export function Form() {
  return <form onSubmit={handleSubmit}>...</form>
}
What changed

Implement the body, remove the unused hook, or make the no-op explicit only when the surrounding API requires it. A function that silently does nothing should not look like finished behavior.

When asked to scaffold, agents stub functions to make types resolve, then forget to come back. The empty body ships and silently no-ops.

How this rule is justified.

Rule id

ai-slop/empty-function

Enforcing engine

ai-slop

Detector strategy

Deterministic AST match: flags function bodies that contain no statements.

Legitimate code that is NOT flagged

Intentional no-op callbacks, abstract method stubs, and interface declarations are not flagged.

Evidence

Provenance: repeated across public scans as scaffolding left unfinished.