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

@ -11,7 +11,7 @@ module.exports = {
"tags": [ "headings", "headers" ],
"function": function MD043(params, onError) {
const requiredHeadings = params.config.headings || params.config.headers;
if (requiredHeadings) {
if (Array.isArray(requiredHeadings)) {
const levels = {};
[ 1, 2, 3, 4, 5, 6 ].forEach(function forLevel(level) {
levels["h" + level] = "######".substr(-level);