mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-22 17:00: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
14
lib/md003.js
14
lib/md003.js
|
|
@ -2,31 +2,31 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
var shared = require("./shared");
|
||||
const shared = require("./shared");
|
||||
|
||||
module.exports = {
|
||||
"names": [ "MD003", "heading-style", "header-style" ],
|
||||
"description": "Heading style",
|
||||
"tags": [ "headings", "headers" ],
|
||||
"function": function MD003(params, onError) {
|
||||
var style = params.config.style || "consistent";
|
||||
let style = params.config.style || "consistent";
|
||||
shared.filterTokens(params, "heading_open", function forToken(token) {
|
||||
var styleForToken = shared.headingStyleFor(token);
|
||||
const styleForToken = shared.headingStyleFor(token);
|
||||
if (style === "consistent") {
|
||||
style = styleForToken;
|
||||
}
|
||||
if (styleForToken !== style) {
|
||||
var h12 = /h[12]/.test(token.tag);
|
||||
var setextWithAtx =
|
||||
const h12 = /h[12]/.test(token.tag);
|
||||
const setextWithAtx =
|
||||
(style === "setext_with_atx") &&
|
||||
((h12 && (styleForToken === "setext")) ||
|
||||
(!h12 && (styleForToken === "atx")));
|
||||
var setextWithAtxClosed =
|
||||
const setextWithAtxClosed =
|
||||
(style === "setext_with_atx_closed") &&
|
||||
((h12 && (styleForToken === "setext")) ||
|
||||
(!h12 && (styleForToken === "atx_closed")));
|
||||
if (!setextWithAtx && !setextWithAtxClosed) {
|
||||
var expected = style;
|
||||
let expected = style;
|
||||
if (style === "setext_with_atx") {
|
||||
expected = h12 ? "setext" : "atx";
|
||||
} else if (style === "setext_with_atx_closed") {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue