$ cnpm install @putout/plugin-apply-consistent-blocks
A block statement is used to group zero or more statements. The block is delimited by a pair of braces ("curly braces") and contains a list of zero or more statements and declarations.
(c) MDN
????Putout plugin adds ability to apply consistent blocks. Check out in ????Putout Editor. Merged to @putout/plugin-conditions.
npm i @putout/plugin-apply-consistent-blocks
{
"rules": {
"apply-consistent-blocks": "on"
}
}
if (a > 3) {
m();
}
if (a > 3)
b = 5;
else {
b = 6;
}
if (a > 3)
b = 5;
else {
b = 6;
fn();
}
if (a > 3)
m();
if (a > 3)
b = 5;
else
b = 6;
if (a > 3) {
b = 5;
} else {
b = 6;
fn();
}
MIT
Copyright 2013 - present © cnpmjs.org | Home |