mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-16 22:10:13 +01:00
Add MD047/single-trailing-newline for enforcing new lines at the end of file (fixes #89).
This commit is contained in:
parent
73511ff677
commit
a977d0dcbc
40 changed files with 130 additions and 56 deletions
27
doc/Rules.md
27
doc/Rules.md
|
|
@ -1576,3 +1576,30 @@ To fix violations of this rule, use a consistent style (either indenting or code
|
|||
|
||||
The specified style can be specific (`fenced`, `indented`) or simply require that usage
|
||||
be consistent within the document (`consistent`).
|
||||
|
||||
<a name="md047"></a>
|
||||
|
||||
## MD047 - Files should end with a single newline character
|
||||
|
||||
Tags: blank_lines
|
||||
|
||||
Aliases: single-trailing-newline
|
||||
|
||||
This rule is triggered when there is not a single newline character at the end of a file.
|
||||
|
||||
Example that triggers the rule:
|
||||
|
||||
```markdown
|
||||
# Heading
|
||||
|
||||
This file ends without a newline.[EOF]
|
||||
```
|
||||
|
||||
To fix the violation, add a newline character to the end of the file:
|
||||
|
||||
```markdown
|
||||
# Heading
|
||||
|
||||
This file ends with a newline.
|
||||
[EOF]
|
||||
```
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue