Renamed rule fore new line at EOF from MD046 to MD047

This commit is contained in:
KitoW 2019-04-05 22:33:19 +02:00
parent 12a51da282
commit 33eaf0bdda
10 changed files with 14 additions and 14 deletions

22
lib/md047.js Normal file
View 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"
});
}
}
};