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
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const shared = require("./shared");
|
||||
const { addErrorContext, flattenLists, isBlankLine } = shared;
|
||||
const { addErrorContext, isBlankLine } = require("./shared");
|
||||
const { flattenedLists } = require("./cache");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD032", "blanks-around-lists" ],
|
||||
|
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
"tags": [ "bullet", "ul", "ol", "blank_lines" ],
|
||||
"function": function MD032(params, onError) {
|
||||
const { lines } = params;
|
||||
flattenLists().filter((list) => !list.nesting).forEach((list) => {
|
||||
flattenedLists().filter((list) => !list.nesting).forEach((list) => {
|
||||
const firstIndex = list.open.map[0];
|
||||
if (!isBlankLine(lines[firstIndex - 1])) {
|
||||
addErrorContext(onError, firstIndex + 1, lines[firstIndex].trim());
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue