mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-09-22 05:40:48 +02:00
Update MD044/proper-names to support specifying multiple casings of the same name (ex: "Abc" and "ABC") (refs #435).
This commit is contained in:
parent
9310713da1
commit
8afec14376
4 changed files with 15 additions and 3 deletions
|
@ -4201,7 +4201,8 @@ module.exports = {
|
||||||
var leftMatch = match[1], nameMatch = match[2];
|
var leftMatch = match[1], nameMatch = match[2];
|
||||||
var index = match.index + leftMatch.length;
|
var index = match.index + leftMatch.length;
|
||||||
var length = nameMatch.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], {
|
addErrorDetailIf(onError, lineIndex + 1, name, nameMatch, null, null, [index + 1, length], {
|
||||||
"editColumn": index + 1,
|
"editColumn": index + 1,
|
||||||
"deleteCount": length,
|
"deleteCount": length,
|
||||||
|
|
|
@ -51,7 +51,10 @@ module.exports = {
|
||||||
const [ , leftMatch, nameMatch ] = match;
|
const [ , leftMatch, nameMatch ] = match;
|
||||||
const index = match.index + leftMatch.length;
|
const index = match.index + leftMatch.length;
|
||||||
const length = nameMatch.length;
|
const length = nameMatch.length;
|
||||||
if (!overlapsAnyRange(exclusions, lineIndex, index, length)) {
|
if (
|
||||||
|
!overlapsAnyRange(exclusions, lineIndex, index, length) &&
|
||||||
|
!names.includes(nameMatch)
|
||||||
|
) {
|
||||||
addErrorDetailIf(
|
addErrorDetailIf(
|
||||||
onError,
|
onError,
|
||||||
lineIndex + 1,
|
lineIndex + 1,
|
||||||
|
|
|
@ -7,7 +7,10 @@
|
||||||
"Node.js",
|
"Node.js",
|
||||||
"GitHub",
|
"GitHub",
|
||||||
"npm",
|
"npm",
|
||||||
"Internet Explorer"
|
"Internet Explorer",
|
||||||
|
"MultipleCase",
|
||||||
|
"multiplecase",
|
||||||
|
"mULTIPLEcASE"
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,3 +79,8 @@ code`
|
||||||
|
|
||||||
`javascript {MD044}
|
`javascript {MD044}
|
||||||
code`
|
code`
|
||||||
|
|
||||||
|
Text referencing multiplecase name.
|
||||||
|
Text referencing MultipleCase name.
|
||||||
|
Text referencing MULTIPLECASE name. {MD044}
|
||||||
|
Text referencing mULTIPLEcASE name.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue