2018-01-21 21:44:25 -08:00
|
|
|
// @ts-check
|
|
|
|
|
|
|
|
"use strict";
|
|
|
|
|
2018-04-27 22:05:34 -07:00
|
|
|
const shared = require("./shared");
|
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) {
|
2018-03-04 23:06:31 -08:00
|
|
|
shared.flattenLists().forEach(function forList(list) {
|
2018-01-21 21:44:25 -08:00
|
|
|
if (list.unordered && !list.nesting) {
|
|
|
|
shared.addErrorDetailIf(onError, list.open.lineNumber,
|
2019-03-24 21:50:56 -07:00
|
|
|
0, list.indent, null, null,
|
2018-01-21 21:44:25 -08:00
|
|
|
shared.rangeFromRegExp(list.open.line, shared.listItemMarkerRe));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
}
|
|
|
|
};
|