Stanza

guard-join

The blank line between a value and the if that checks it.

A single-line declaration or assignment is followed directly by an if that references what it binds, whatever the body size and with or without else.

function load(id: string, cache: Map<string, Record>) {
  const record = cache.get(id);

  if (!record) {
    log(`miss ${id}`);
    return null;
  }

  return record;
}

Applies when a single-line declaration (const, let or var, plain or destructured, every bound name counts) or a single-line assignment is followed by an if that reads one of the names it binds. The blank line between them goes. The size of the if body does not matter and an else does not matter: the if is the step that consumes the value, so in the example the two statement block still joins const record. let count: number; followed by an if that assigns count joins too.

short-body outranks it and removes the blank anyway. after-multiline outranks it the other way: a declaration that spans lines keeps a blank line after it, however clearly the if reads it. A gap next to a stanza-ignore statement is frozen and never joins.