Skip to content

yml/indent

enforce consistent indentation

  • ⚙️ This rule is included in "plugin:yml/standard".
  • 🔧 The --fix option on the command line can automatically fix some of the problems reported by this rule.

📖 Rule Details

This rule reports enforces a consistent indentation style. The default style is 2 spaces.

Now loading...

🔧 Options

yaml
yml/indent:
  - error
  - 2
  - indentBlockSequences: true
    indicatorValueIndent: 2
  • Number option ... Specify the number of indents.
  • Object option
    • indentBlockSequences ... Specifies whether block sequences should be indented or not (when in a mapping).
    • indicatorValueIndent ... Specifies the number of indents from indicator marks. Defaults to specified indent.

"indentBlockSequences": true (default)

Now loading...

"indentBlockSequences": false

Now loading...

[4, "indicatorValueIndent": 2]

Now loading...

🚀 Version

This rule was introduced in eslint-plugin-yml v0.1.0

🔍 Implementation