Mario Parra
Mario Parra

Reputation: 1554

Markdown "missing newline character" linting error

I'm trying out Markdown and writing some basic code in my editor, but I'm getting the error final-newline Missing newline character at the end of file at line 0 col 0.

As far as I can tell, Markdown doesn't require a new line character, so I'm not sure what this means. I'm using the "linter" package for Atom with "linter-markdown", which is using the GitHub flavour.

My Markdown:

#Heading 1
**Bold text**

EDIT: I just noticed that the error clears when I save the file. Any explanation for this?

Upvotes: 0

Views: 610

Answers (1)

Waylan
Waylan

Reputation: 42487

Wikipedia notes that:

modern lint checkers are often used to find code that doesn't correspond to certain style guidelines.

In fact, lint checkers tend to encourage best practices, not just the minimum required set of rules, and therefore are often more strict that the minimum set of rules. It is often considered best practice to follow the style guideline of ending all plain text files (including Markdown files) with a blank line even if not strictly necessary. Just like it is generally considered best practice to follow the style guideline to not have trailing spaces at the end of lines (unless of course, they are syntactically significant, as they are in Markdown). You will find that some text editors will offer the added functionality of cleaning up such things for you automatically. I suspect that is what Atom is doing.

Upvotes: 1

Related Questions