Skip to content

yml/plain-scalar

require or disallow plain style scalar.

  • ⚙️ 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 aims to use consistent style of plain or quoted styles.

Now loading...

🔧 Options

yaml
yml/plain-scalar:
  - error
  - always # or "never"
  - ignorePatterns:
    - "[\\v\\f\\u0085\\u00a0\\u1680\\u180e\\u2000-\\u200b\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]"
  • "always" ... Enforce the use of plain style scalars.
  • "never" ... Disallow the use of plain style scalars.
  • ignorePatterns ... Specify the pattern to be excluded from the check as an array.
    If "always", the default is [ "[\\v\\f\\u0085\\u00a0\\u1680\\u180e\\u2000-\\u200b\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]" ]. It to ignores irregular whitespace.

🚀 Version

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

🔍 Implementation