Disallows blocks from beginning or ending with 2 newlines.
Type: Boolean
or Object
Values:
true
validates all non-empty blocks.Object
:'open'
true
validates that there is a newline after the opening brace in a blockfalse
ignores the newline validation after the opening brace in a block'close'
true
validates that there is a newline before the closing brace in a blockfalse
ignores the newline validation before the closing brace in a block'allExcept'
array of exceptions:'conditionals'
ignores conditional (if, else if, else) blocks'functions'
ignores function blocks"disallowPaddingNewlinesInBlocks": true
"disallowPaddingNewlinesInBlocks": { "open": true, "close": false }
"disallowPaddingNewlinesInBlocks": { "allExcept": [ "conditionals" ] }
"disallowPaddingNewlinesInBlocks": { "open": true, "close": false, allExcept: ['conditionals'] }
true
if (true) {
doSomething();
}
if (true) {doSomething();}
var abc = function() {};
{ "open": true, "close": false }
if (true) {
doSomething();
}
{ allExcept: ['conditionals'] }
if (true) {
doSomething();
}
function (foo) {
return bar;
}
{ "open": true, "close": false, allExcept: ['conditionals'] }
function (foo) {
return bar;
}
if (true) {
doSomething();
}
if (true) {
doSomething();
}