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,7 +2,7 @@
"use strict";
var shared = require("./shared");
const shared = require("./shared");
// Returns the unordered list style for a list item token
function unorderedListStyleFor(token) {
@ -22,18 +22,18 @@ module.exports = {
"description": "Unordered list style",
"tags": [ "bullet", "ul" ],
"function": function MD004(params, onError) {
var style = params.config.style || "consistent";
var expectedStyle = style;
var nestingStyles = [];
const style = params.config.style || "consistent";
let expectedStyle = style;
const nestingStyles = [];
shared.flattenLists().forEach(function forList(list) {
if (list.unordered) {
if (expectedStyle === "consistent") {
expectedStyle = unorderedListStyleFor(list.items[0]);
}
list.items.forEach(function forItem(item) {
var itemStyle = unorderedListStyleFor(item);
const itemStyle = unorderedListStyleFor(item);
if (style === "sublist") {
var nesting = list.nesting;
const nesting = list.nesting;
if (!nestingStyles[nesting] &&
(itemStyle !== nestingStyles[nesting - 1])) {
nestingStyles[nesting] = itemStyle;