Skip to content

final_newline

File must end with a single \n. Fixable via file_append_final_newline.

This rule takes no kind-specific options.

Plus the common paths, level, id, and when fields. This table is generated from the JSON Schema; option types and defaults are authoritative.

A Markdown file missing its trailing newline

Section titled “A Markdown file missing its trailing newline”

The rule fires on this repository:

docs/
docs/clean.md
docs/missing.md
docs/clean.md
# Hi
docs/missing.md
# No newline

With this .alint.yml:

version: 1
rules:
- id: eof
kind: final_newline
paths: "docs/**/*.md"
level: error

alint check reports:

Terminal window
--- docs/missing.md ------------------------------------------------------------
x error eof
file does not end with a newline
Summary (1 violation):
x 1 error
0 passing * 1 failing

This repository is compliant:

docs/
docs/a.md
docs/b.md
docs/empty.md
docs/a.md
# Hi
docs/b.md
Hello
world

With this .alint.yml:

version: 1
rules:
- id: eof
kind: final_newline
paths: "docs/**/*.md"
level: error

alint check reports:

Terminal window
v All 1 rule(s) passed.