MDS009: single-trailing-newline
File must end with exactly one newline character.
# Config
Enable:
rules:
single-trailing-newline: trueDisable:
rules:
single-trailing-newline: false# Examples
# Good
# Title
Content here.The file ends with exactly one \n after the last line.
# Bad
# Title
Content here.The file has no trailing newline after the last line.
The <?include?> output looks identical because the
wrap always adds a newline, but the actual fixture file
(bad/default.md) ends without one — that missing byte
is what the rule detects.
# Meta-Information
- ID: MDS009
- Name:
single-trailing-newline - Status: ready
- Default: enabled
- Fixable: yes
- Implementation: source
- Category: whitespace
- markdownlint: MD047 (single-trailing-newline)
- rumdl: MD047 (file-end-newline)
- mado: MD047 (single-trailing-newline)
- obsidian-linter: line-break-at-document-end
- gomarklint: final-blank-line