The braceless body of an if or loop is on the next line but not indented, so it reads as the next statement

tx0/ts:unindented-conditional-bodyrecommendedwarningreliability/control-flowdepth fastbug

What it finds

A body without braces on its own line belongs to the statement above only by its position after the head. Written at the same indentation as the head, it looks like the next statement that always runs.

Reported are braceless bodies of if, for and while on a line of their own that do not start to the right of the head.

From the rule's source, unindented_conditional_body.rs.

Example from the rule's tests
export function warn(bad: boolean, log: () => void) {  if (bad)  log();tx0 reports: this body is not indented}
Highlighted lines are the ones tx0 reports, with its message under each; the other lines are left alone.

Turn it on, off or suppress it

The rule runs from the recommended tier up. To turn it on in a lower tier, give it a level in tx0.toml:

tx0.toml
[rules]
"tx0/ts:unindented-conditional-body" = "warning"

To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:

// tx0: ignore[tx0/ts:unindented-conditional-body] reason="..."

tx0 explain tx0/ts:unindented-conditional-body shows the same in the terminal. Found a false positive? Report it.