2018-01-21 21:44:25 -08:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2019-04-10 21:26:59 -07:00
|
|
|
const { addErrorDetailIf, listItemMarkerRe, rangeFromRegExp } =
|
|
|
|
require("./shared");
|
|
|
|
const { flattenedLists } = require("./cache");
|
2018-01-21 21:44:25 -08:00
|
|
|
|
|
|
|
module.exports = {
|
|
|
|
"names": [ "MD006", "ul-start-left" ],
|
|
|
|
"description":
|
|
|
|
"Consider starting bulleted lists at the beginning of the line",
|
|
|
|
"tags": [ "bullet", "ul", "indentation" ],
|
|
|
|
"function": function MD006(params, onError) {
|
2019-04-10 21:26:59 -07:00
|
|
|
flattenedLists().forEach((list) => {
|
2018-01-21 21:44:25 -08:00
|
|
|
if (list.unordered && !list.nesting) {
|
2019-04-10 21:26:59 -07:00
|
|
|
addErrorDetailIf(onError, list.open.lineNumber,
|
2019-03-24 21:50:56 -07:00
|
|
|
0, list.indent, null, null,
|
2019-04-10 21:26:59 -07:00
|
|
|
rangeFromRegExp(list.open.line, listItemMarkerRe));
|
2018-01-21 21:44:25 -08:00
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|