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");
module.exports = {
"names": [ "MD037", "no-space-in-emphasis" ],
@ -10,17 +10,17 @@ module.exports = {
"tags": [ "whitespace", "emphasis" ],
"function": function MD037(params, onError) {
shared.forEachInlineChild(params, "text", function forToken(token) {
var left = true;
var match = /\s(\*\*?|__?)\s.+\1/.exec(token.content);
let left = true;
let match = /\s(\*\*?|__?)\s.+\1/.exec(token.content);
if (!match) {
left = false;
match = /(\*\*?|__?).+\s\1\s/.exec(token.content);
}
if (match) {
var text = match[0].trim();
var line = params.lines[token.lineNumber - 1];
var column = line.indexOf(text) + 1;
var length = text.length;
const text = match[0].trim();
const line = params.lines[token.lineNumber - 1];
const column = line.indexOf(text) + 1;
const length = text.length;
shared.addErrorContext(onError, token.lineNumber,
text, left, !left, [ column, length ]);
}