Add rule name and file/string identifier to Error message thrown by onError validation for rules.

This commit is contained in:
David Anson 2023-10-07 19:32:29 -07:00
parent 74f4163a10
commit d2faf40e6a
3 changed files with 16 additions and 8 deletions

View file

@ -2354,7 +2354,8 @@ function lintContent(ruleList, aliasToRuleNames, name, content, md, config, conf
});
// eslint-disable-next-line jsdoc/require-jsdoc
function throwError(property) {
throw new Error("Property '" + property + "' of onError parameter is incorrect.");
throw new Error( // eslint-disable-next-line max-len
"Value of '".concat(property, "' passed to onError by '").concat(ruleName, "' is incorrect for '").concat(name, "'."));
}
// eslint-disable-next-line jsdoc/require-jsdoc
function onError(errorInfo) {