Update MD044/proper-names to support specifying multiple casings of the same name (ex: "Abc" and "ABC") (refs #435).

This commit is contained in:
David Anson 2022-04-22 20:41:42 -07:00
parent 9310713da1
commit 8afec14376
4 changed files with 15 additions and 3 deletions

View file

@ -4201,7 +4201,8 @@ module.exports = {
var leftMatch = match[1], nameMatch = match[2];
var index = match.index + leftMatch.length;
var length = nameMatch.length;
if (!overlapsAnyRange(exclusions, lineIndex, index, length)) {
if (!overlapsAnyRange(exclusions, lineIndex, index, length) &&
!names.includes(nameMatch)) {
addErrorDetailIf(onError, lineIndex + 1, name, nameMatch, null, null, [index + 1, length], {
"editColumn": index + 1,
"deleteCount": length,