Skip to content

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.

---
---
...
---
---
key: value
---
key: value
---

This rule is not configurable.

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.

Made with ❤️‍🔥 in Boston by Josh Goldberg and contributors.