mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Remove state from shared.js, move to cache.js.
This commit is contained in:
parent
827e1acb56
commit
f614f3e1ce
17 changed files with 124 additions and 98 deletions
10
lib/md007.js
10
lib/md007.js
|
|
@ -2,7 +2,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const shared = require("./shared");
|
||||
const { addErrorDetailIf, listItemMarkerRe, rangeFromRegExp } =
|
||||
require("./shared");
|
||||
const { flattenedLists } = require("./cache");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD007", "ul-indent" ],
|
||||
|
|
@ -10,11 +12,11 @@ module.exports = {
|
|||
"tags": [ "bullet", "ul", "indentation" ],
|
||||
"function": function MD007(params, onError) {
|
||||
const optionsIndent = params.config.indent || 2;
|
||||
shared.flattenLists().forEach(function forList(list) {
|
||||
flattenedLists().forEach((list) => {
|
||||
if (list.unordered && list.parentsUnordered && list.indent) {
|
||||
shared.addErrorDetailIf(onError, list.open.lineNumber,
|
||||
addErrorDetailIf(onError, list.open.lineNumber,
|
||||
list.parentIndent + optionsIndent, list.indent, null, null,
|
||||
shared.rangeFromRegExp(list.open.line, shared.listItemMarkerRe));
|
||||
rangeFromRegExp(list.open.line, listItemMarkerRe));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue