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 atxClosedHeadingSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/;
|
||||
const atxClosedHeadingSpaceRe = /(?:^#+\s\s+?\S)|(?:\S\s\s+?#+\s*$)/;
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD021", "no-multiple-space-closed-atx" ],
|
||||
|
|
@ -13,8 +13,8 @@ module.exports = {
|
|||
"function": function MD021(params, onError) {
|
||||
shared.filterTokens(params, "heading_open", function forToken(token) {
|
||||
if (shared.headingStyleFor(token) === "atx_closed") {
|
||||
var left = /^#+\s\s/.test(token.line);
|
||||
var right = /\s\s#+$/.test(token.line);
|
||||
const left = /^#+\s\s/.test(token.line);
|
||||
const right = /\s\s#+$/.test(token.line);
|
||||
if (left || right) {
|
||||
shared.addErrorContext(onError, token.lineNumber, token.line.trim(),
|
||||
left, right,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue