Stanza

switch-clauses

The blank line between switch clauses, and the label that falls through.

A blank line goes in between switch clauses and none is ever removed; the gap under a fall through label with an empty body is left as it is.

function label(status: Status) {
  switch (status) {
    case "draft":
    case "open": return "Open";

    case "closed": return "Closed";

    default: return "Unknown";
  }
}

Applies inside a switch, between a case or default that has a body and the label after it. Stanza inserts a blank line there and never removes one: a blank line between clauses always stays, however many statements the clause holds.

A label with an empty body falls through to the next label and gets no decision of its own. Whatever sits above the next label stays as it is, so in the example case "draft": stays directly above case "open":.

The rule only reports when a label and its body share a line, as in the example. A clause whose body starts on the next line spans lines, so after-multiline decides that gap first. The effect is the same: one blank line before the next label.

A comment alone between a body and the next label goes one of two ways. A comment that starts with "falls through" or "fallthrough" belongs to the clause above it, so the blank line goes after the comment. Any other comment leads the next clause, and the blank line goes above it.