mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Move each rule implementation into its own file (fixes #83).
This commit is contained in:
parent
49e36f817c
commit
9ba143555d
42 changed files with 1289 additions and 1028 deletions
21
lib/md005.js
Normal file
21
lib/md005.js
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
// @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));
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue