Update all rules to better handle wrongly-typed configuration parameters.

This commit is contained in:
David Anson 2020-01-25 18:40:39 -08:00
parent 26ad0550ec
commit 3238ed4249
25 changed files with 134 additions and 39 deletions

View file

@ -10,7 +10,7 @@ module.exports = {
"description": "Heading style",
"tags": [ "headings", "headers" ],
"function": function MD003(params, onError) {
let style = params.config.style || "consistent";
let style = String(params.config.style || "consistent");
filterTokens(params, "heading_open", function forToken(token) {
const styleForToken = headingStyleFor(token);
if (style === "consistent") {