if
condition RS-C1008Using block expressions as if
conditions can confuse readers of this code.
Consider creating a let
binding.
// useless block
if { true } { /* ... */ }
// hard-to-read block
if { let x = a(); b } { /* ... */ }
// remove useless braces
if true { /* ... */ }
// create an explicit binding
let res = {
let x = a();
b
};
if res { /* ... */ }