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.
🔧 Options
yaml
yml/plain-scalar:
- error
- always # or "never"
- ignorePatterns:
- "[\\v\\f\\u0085\\u00a0\\u1680\\u180e\\u2000-\\u200b\\u2028\\u2029\\u202f\\u205f\\u3000\\ufeff]"
overrides:
mappingKey: null # or "always" or "never"
"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.overrides
... Overrides any setting to a specific value.mappingKey
... Specify the style to use for the mapping key.
👫 Related rules
🚀 Version
This rule was introduced in eslint-plugin-yml v0.3.0