Convert var to const/let (except in browser-only code).

This commit is contained in:
David Anson 2018-04-27 22:05:34 -07:00
parent 78c1af7bfd
commit 213aef4564
56 changed files with 524 additions and 518 deletions

View file

@ -2,17 +2,17 @@
"use strict";
var shared = require("./shared");
const shared = require("./shared");
var spaceAfterBlockQuote = /^\s*(?:>\s+)+\S/;
const spaceAfterBlockQuote = /^\s*(?:>\s+)+\S/;
module.exports = {
"names": [ "MD027", "no-multiple-space-blockquote" ],
"description": "Multiple spaces after blockquote symbol",
"tags": [ "blockquote", "whitespace", "indentation" ],
"function": function MD027(params, onError) {
var blockquoteNesting = 0;
var listItemNesting = 0;
let blockquoteNesting = 0;
let listItemNesting = 0;
params.tokens.forEach(function forToken(token) {
if (token.type === "blockquote_open") {
blockquoteNesting++;
@ -23,7 +23,7 @@ module.exports = {
} else if (token.type === "list_item_close") {
listItemNesting--;
} else if ((token.type === "inline") && (blockquoteNesting > 0)) {
var multipleSpaces = listItemNesting ?
const multipleSpaces = listItemNesting ?
/^(\s*>)+\s\s+>/.test(token.line) :
/^(\s*>)+\s\s/.test(token.line);
if (multipleSpaces) {