plainScalars
Prefer plain style scalars over quoted scalars.
✅ This rule is included in the yaml stylisticStrict presets.
Plain scalars are more readable and concise than quoted scalars. Quoted scalars should only be used when the value cannot be represented as a plain scalar.
Examples
Section titled “Examples”name: "simple"key: "value"name: simplekey: value# Quotes are needed for special valuesenabled: "true"# Quotes are needed for values with special charactersmessage: "contains: colon"Options
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”If your project prefers quoted strings for consistency or compatibility with other tools, you may not need this rule. Some YAML consumers may handle quoted and unquoted strings differently.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
yml/plain-scalar
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.