emptyDocuments
Reports empty YAML documents that contain only document markers.
✅ This rule is included in the yaml logical presets.
Empty YAML documents contain only document markers (--- or ...) without any content.
These empty documents serve no purpose and typically result from editing mistakes or incomplete refactoring.
Removing them improves file clarity and reduces confusion.
Examples
Section titled “Examples”------...------key: value---key: value---key: value---key: value---key: value---another: valueOptions
Section titled “Options”This rule is not configurable.
When Not To Use It
Section titled “When Not To Use It”If you have a specific workflow or tooling that intentionally creates or relies on empty YAML documents for placeholders or other purposes, you might choose to disable this rule. However, in most cases, empty documents indicate an error and should be removed.
Further Reading
Section titled “Further Reading”Equivalents in Other Linters
Section titled “Equivalents in Other Linters”- ESLint:
yml/no-empty-document
Made with ❤️🔥 in Boston by
Josh Goldberg and contributors.