mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-20 16:00: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
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const shared = require("./shared");
|
||||
const { addError, filterTokens, forEachLine, includesSorted, rangeFromRegExp,
|
||||
trimRight } = shared;
|
||||
trimRight } = require("./shared");
|
||||
const { lineMetadata } = require("./cache");
|
||||
|
||||
const trailingSpaceRe = /\s+$/;
|
||||
|
||||
|
|
@ -30,7 +30,7 @@ module.exports = {
|
|||
listItemLineNumbers.sort((a, b) => a - b);
|
||||
}
|
||||
const expected = (brSpaces < 2) ? 0 : brSpaces;
|
||||
forEachLine((line, lineIndex) => {
|
||||
forEachLine(lineMetadata(), (line, lineIndex) => {
|
||||
const lineNumber = lineIndex + 1;
|
||||
if (trailingSpaceRe.test(line) &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue