mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
21 lines
662 B
JavaScript
21 lines
662 B
JavaScript
// @ts-check
|
|
|
|
"use strict";
|
|
|
|
var shared = require("./shared");
|
|
|
|
module.exports = {
|
|
"names": [ "MD005", "list-indent" ],
|
|
"description": "Inconsistent indentation for list items at the same level",
|
|
"tags": [ "bullet", "ul", "indentation" ],
|
|
"function": function MD005(params, onError) {
|
|
shared.flattenLists(params).forEach(function forList(list) {
|
|
var indent = shared.indentFor(list.items[0]);
|
|
list.items.forEach(function forItem(item) {
|
|
shared.addErrorDetailIf(onError, item.lineNumber, indent,
|
|
shared.indentFor(item), null,
|
|
shared.rangeFromRegExp(item.line, shared.listItemMarkerRe));
|
|
});
|
|
});
|
|
}
|
|
};
|