mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-18 23:10:12 +01:00
Renamed rule fore new line at EOF from MD046 to MD047
This commit is contained in:
parent
12a51da282
commit
33eaf0bdda
10 changed files with 14 additions and 14 deletions
22
lib/md047.js
Normal file
22
lib/md047.js
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
// @ts-check
|
||||
|
||||
"use strict";
|
||||
|
||||
const shared = require("./shared");
|
||||
const { isBlankLine } = shared;
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD047", "new-line-eof" ],
|
||||
"description": "New lines at the end of file",
|
||||
"tags": [ "blank_lines" ],
|
||||
"function": function rule(params, onError) {
|
||||
const lastLineNumber = params.lines.length;
|
||||
const lastLine = params.lines[lastLineNumber - 1];
|
||||
if (!isBlankLine(lastLine)) {
|
||||
onError({
|
||||
"lineNumber": lastLineNumber,
|
||||
"detail": "file does not end with new line"
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue