Showing 21 of 21 total issues
Expected indentation of 2 spaces but found 4. Open
Open
asciidocRender: AsciidocRender
- Read upRead up
- Exclude checks
Rule: ter-indent
enforce consistent indentation
Rationale
Using only one of tabs or spaces for indentation leads to more consistent editor behavior, cleaner diffs in version control, and easier programmatic manipulation.
Notes
- Has Fix
Config
The string 'tab' or an integer indicating the number of spaces to use per tab.
An object may be provided to fine tune the indentation rules:
-
"SwitchCase"
(default: 0) enforces indentation level forcase
clauses inswitch
statements -
"VariableDeclarator"
(default: 1) enforces indentation level forvar
declarators; can also take an object to define separate rules forvar
,let
andconst
declarations. -
"outerIIFEBody"
(default: 1) enforces indentation level for file-level IIFEs. -
"MemberExpression"
(off by default) enforces indentation level for multi-line property chains (except in variable declarations and assignments) -
"FunctionDeclaration"
takes an object to define rules for function declarations.-
"parameters"
(off by default) enforces indentation level for parameters in a function declaration. This can either be a number indicating indentation level, or the string"first"
indicating that all parameters of the declaration must be aligned with the first parameter. -
"body"
(default: 1) enforces indentation level for the body of a function expression.
-
-
"FunctionExpression"
takes an object to define rules for function declarations.-
"parameters"
(off by default) enforces indentation level for parameters in a function declaration. This can either be a number indicating indentation level, or the string"first"
indicating that all parameters of the declaration must be aligned with the first parameter. -
"body"
(default: 1) enforces indentation level for the body of a function expression.
-
-
"CallExpression"
takes an object to define rules for function call expressions.-
"arguments"
(off by default) enforces indentation level for arguments in a call expression. This can either be a number indicating indentation level, or the string"first"
indicating that all arguments of the expression must be aligned with the first argument.
-
Examples
"ter-indent":
"ter-indent": [true, "tab"]
"ter-indent":
"ter-indent": [true, 2]
"ter-indent":
"ter-indent": [
true,
2,
{
"FunctionExpression": {
"parameters": 1,
"body": 1
}
}
]
Schema
{
"type": "array",
"items": [
{
"type": "number",
"minimum": "0"
},
{
"type": "string",
"enum": [
"tab"
]
},
{
"type": "object",
"properties": {
"SwitchCase": {
"type": "number",
"minimum": 0
},
"VariableDeclarator": {
"type": "object",
"properties": {
"var": {
"type": "number",
"minimum": 0
},
"let": {
"type": "number",
"minimum": 0
},
"const": {
"type": "number",
"minimum": 0
}
}
},
"outerIIFEBody": {
"type": "number"
},
"FunctionDeclaration": {
"type": "object",
"properties": {
"parameters": {
"type": "number",
"minimum": 0
},
"body": {
"type": "number",
"minimum": 0
}
}
},
"FunctionExpression": {
"type": "object",
"properties": {
"parameters": {
"type": "number",
"minimum": 0
},
"body": {
"type": "number",
"minimum": 0
}
}
},
"MemberExpression": {
"type": "number"
},
"CallExpression": {
"type": "object",
"properties": {
"arguments": {
"type": "number",
"minimum": 0
}
}
}
},
"additionalProperties": false
}
],
"minLength": 1,
"maxLength": 2
}
For more information see this page.