Skip to main content

indentation 🪄

Allows the user to specify indentation rules. This rule can be configured in a more granular level and uses following rules by default:

  • Expected indentation for Feature, Background, Scenario, Examples heading: 0 spaces
  • Expected indentation for Steps and each example: 2 spaces

Configuration

NameTypeDescriptionDefault
FeaturenumberDefines the indentation size for the node Feature.0
BackgroundnumberDefines the indentation size for the node Background.2
RulenumberDefines the indentation size for the node Rule.2
ScenarionumberDefines the indentation size for the node Scenario.2
StepnumberDefines the indentation size for the node Step.4
ExamplesnumberDefines the indentation size for the node Examples.4
examplenumberDefines the indentation size for the node example.6
givennumberDefines the indentation size for the node given.4
whennumberDefines the indentation size for the node when.4
thennumberDefines the indentation size for the node then.4
andnumberDefines the indentation size for the node and.4
butnumberDefines the indentation size for the node but.4
RuleFallbacknumberIf enabled, the indentation for nodes inside Rule is the sum of "Rule" and the node itself, else it uses the node directly.true

Examples

Example

Override some indentations

{
"indentation": [
"error",
{
"Feature": 0,
"Background": 2,
"Scenario": 2,
"Step": 4,
"Examples": 2,
"example": 3,
"given": 3,
"when": 3,
"then": 3,
"and": 3,
"but": 3,
"feature tag": 0,
"scenario tag": 2,
"examples tag": 2
}
]
}