Skip to content

yml/key-spacing

enforce consistent spacing between keys and values in mapping pairs

  • ⚙️ 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 enforces consistent spacing between keys and values in mapping pairs. In the case of long lines, it is acceptable to add a new line wherever whitespace is allowed.

Now loading...

🔧 Options

yaml
yml/key-spacing:
  - error
  - beforeColon: false
    afterColon: true
    mode: strict # or "minimum"
    # "align": "value" or "colon"
    # "singleLine": {}
    # "multiLine": {}

Same as key-spacing rule option. See here for details.

🚀 Version

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

🔍 Implementation

Taken with ❤️ from ESLint core