mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +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
|
|
@ -2,9 +2,9 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var shared = require("./shared");
|
||||
const shared = require("./shared");
|
||||
|
||||
var atxClosedHeadingNoSpaceRe = /(?:^#+[^#\s])|(?:[^#\s]#+\s*$)/;
|
||||
const atxClosedHeadingNoSpaceRe = /(?:^#+[^#\s])|(?:[^#\s]#+\s*$)/;
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD020", "no-missing-space-closed-atx" ],
|
||||
|
|
@ -13,8 +13,8 @@ module.exports = {
|
|||
"function": function MD020(params, onError) {
|
||||
shared.forEachLine(function forLine(line, lineIndex, inCode) {
|
||||
if (!inCode && /^#+[^#]*[^\\]#+$/.test(line)) {
|
||||
var left = /^#+[^#\s]/.test(line);
|
||||
var right = /[^#\s]#+$/.test(line);
|
||||
const left = /^#+[^#\s]/.test(line);
|
||||
const right = /[^#\s]#+$/.test(line);
|
||||
if (left || right) {
|
||||
shared.addErrorContext(onError, lineIndex + 1, line.trim(), left,
|
||||
right, shared.rangeFromRegExp(line, atxClosedHeadingNoSpaceRe));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue