mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-18 06:50:12 +01:00
Everything under `lib/rules/*` is a rules file (with the name of the rule in camelCase), re-exported into an array in `lib/rules.js`. Moved the regular expressions from `lib/rules.js` to `lib/expressions.js`, and the rest of the variables into `lib/shared.js`.
18 lines
621 B
JavaScript
18 lines
621 B
JavaScript
var expressions = require("../expressions");
|
|
var shared = require("../shared");
|
|
|
|
module.exports = {
|
|
"name": "MD005",
|
|
"desc": "Inconsistent indentation for list items at the same level",
|
|
"tags": [ "bullet", "ul", "indentation" ],
|
|
"aliases": [ "list-indent" ],
|
|
"regexp": expressions.listItemMarkerRe,
|
|
"func": function MD005(params, errors) {
|
|
shared.flattenLists(params).forEach(function forList(list) {
|
|
var indent = shared.indentFor(list.items[0]);
|
|
list.items.forEach(function forItem(item) {
|
|
errors.addDetailIf(item.lineNumber, indent, shared.indentFor(item));
|
|
});
|
|
});
|
|
}
|
|
};
|