Skip to content

VBC-946: no-verification-after-operation

warning

Category: correctness
Analysis: Regex (whole file)
File types: .js, .ts, .tsx, .astro
Scope: source code only, ignoring anything inside strings and comments
Tags: correctness ai-error

What it reports

Destructive async operation at line {line} with no verification of success. AI agents frequently execute irreversible actions (delete, drop, rm) based on assumed success without checking the return value or catching errors. Always verify the outcome of destructive operations before proceeding.

Flagged

js
await db.delete(id);

Not flagged

js
await db.delete(id);
if (!(await db.find(id))) throw new Error("gone");

Pattern

regex
await\s+\w+\.(delete|remove|drop|truncate|destroy|unlink|rmdir|rm)\s*\([^)]*\)\s*;(?!\s*(?:\/\/|if|const|let|var|throw|assert|expect|check|verify|log))

Released under the MIT License.