mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Convert var to const/let (except in browser-only code).
This commit is contained in:
parent
78c1af7bfd
commit
213aef4564
56 changed files with 524 additions and 518 deletions
18
lib/md030.js
18
lib/md030.js
|
|
@ -2,25 +2,25 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var shared = require("./shared");
|
||||
const shared = require("./shared");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD030", "list-marker-space" ],
|
||||
"description": "Spaces after list markers",
|
||||
"tags": [ "ol", "ul", "whitespace" ],
|
||||
"function": function MD030(params, onError) {
|
||||
var ulSingle = params.config.ul_single || 1;
|
||||
var olSingle = params.config.ol_single || 1;
|
||||
var ulMulti = params.config.ul_multi || 1;
|
||||
var olMulti = params.config.ol_multi || 1;
|
||||
const ulSingle = params.config.ul_single || 1;
|
||||
const olSingle = params.config.ol_single || 1;
|
||||
const ulMulti = params.config.ul_multi || 1;
|
||||
const olMulti = params.config.ol_multi || 1;
|
||||
shared.flattenLists().forEach(function forList(list) {
|
||||
var lineCount = list.lastLineIndex - list.open.map[0];
|
||||
var allSingle = lineCount === list.items.length;
|
||||
var expectedSpaces = list.unordered ?
|
||||
const lineCount = list.lastLineIndex - list.open.map[0];
|
||||
const allSingle = lineCount === list.items.length;
|
||||
const expectedSpaces = list.unordered ?
|
||||
(allSingle ? ulSingle : ulMulti) :
|
||||
(allSingle ? olSingle : olMulti);
|
||||
list.items.forEach(function forItem(item) {
|
||||
var match = /^[\s>]*\S+(\s+)/.exec(item.line);
|
||||
const match = /^[\s>]*\S+(\s+)/.exec(item.line);
|
||||
shared.addErrorDetailIf(onError, item.lineNumber,
|
||||
expectedSpaces, (match ? match[1].length : 0), null,
|
||||
shared.rangeFromRegExp(item.line, shared.listItemMarkerRe));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue