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,8 @@ module.exports = {
"description": "Proper names should have the correct capitalization",
"tags": [ "spelling" ],
"function": function MD044(params, onError) {
const names = params.config.names || [];
let names = params.config.names;
names = Array.isArray(names) ? names : [];
const codeBlocks = params.config.code_blocks;
const includeCodeBlocks = (codeBlocks === undefined) ? true : !!codeBlocks;
names.forEach((name) => {