# 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 (opens new window) 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

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

Same as key-spacing (opens new window) rule option. See here (opens new window) for details.

# 🚀 Version

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

# 🔍 Implementation

Taken with ❤️ from ESLint core (opens new window)