JSCS (original) (raw)
validateIndentation
Validates indentation for switch statements and block statements
Types: Integer
, String
or Object
Values:
Integer
: A positive number of spacesString
:"\t"
for tab indentationObject
:value
: (required) the same effect as the non-object valuesincludeEmptyLines
(deprecated): (default:false
) require empty lines to be indented'allExcept'
array of exceptions:
*'comments'
ignores comments
*'emptyLines'
ignore empty lines, included by default
JSHint: indent
Example
"validateIndentation": "\t"
Valid example for mode 2
if (a) {
b=c;
function(d) {
e=f;
}
}
Invalid example for mode 2
if (a) {
b=c;
function(d) {
e=f;
}
}
Valid example for mode "\t"
if (a) {
b=c;
function(d) {
e=f;
}
}
Invalid example for mode "\t"
if (a) {
b=c;
function(d) {
e=f;
}
}
Valid example for mode { "value": "\t", "allExcept": ["emptyLines"] }
if (a) {
b=c;
function(d) {
e=f;
}
} // single tab character on previous line
Invalid example for mode { "value": "\t", "allExcept": ["emptyLines"] } }
if (a) {
b=c;
function(d) {
e=f;
}
} // no tab character on previous line
if (a) {
b=c;
// e=f
}