Skip to content

VBC-063: empty-else

warning

Category: clean-code
Analysis: Regex (line by line)
File types: .js, .ts, .tsx, .py, .astro
Scope: source code only, ignoring anything inside strings and comments
Tags: clean-code

What it reports

Empty else block detected at line {line}. This clutters the code.

Flagged

js
if (ready) { start(); } else {}

Not flagged

js
if (ready) { start(); } else { stop(); }

Pattern

regex
else\s*\{\s*\}

Released under the MIT License.