mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20:12 +01:00
Update dependencies: eslint-plugin-jsdoc to 31.6.0, eslint-plugin-unicorn to 27.0.0.
This commit is contained in:
parent
ec907567e2
commit
c87d7f5b8c
13 changed files with 95 additions and 74 deletions
44
lib/md009.js
44
lib/md009.js
|
|
@ -49,26 +49,30 @@ module.exports = {
|
|||
const expected = (brSpaces < 2) ? 0 : brSpaces;
|
||||
forEachLine(lineMetadata(), (line, lineIndex, inCode) => {
|
||||
const lineNumber = lineIndex + 1;
|
||||
const trailingSpaces = line.length - line.trimRight().length;
|
||||
if (trailingSpaces && !inCode &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber)) {
|
||||
if ((expected !== trailingSpaces) ||
|
||||
(strict &&
|
||||
(!includesSorted(paragraphLineNumbers, lineNumber) ||
|
||||
includesSorted(codeInlineLineNumbers, lineNumber)))) {
|
||||
const column = line.length - trailingSpaces + 1;
|
||||
addError(
|
||||
onError,
|
||||
lineNumber,
|
||||
"Expected: " + (expected === 0 ? "" : "0 or ") +
|
||||
expected + "; Actual: " + trailingSpaces,
|
||||
null,
|
||||
[ column, trailingSpaces ],
|
||||
{
|
||||
"editColumn": column,
|
||||
"deleteCount": trailingSpaces
|
||||
});
|
||||
}
|
||||
const trailingSpaces = line.length - line.trimEnd().length;
|
||||
if (
|
||||
trailingSpaces &&
|
||||
!inCode &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber) &&
|
||||
(
|
||||
(expected !== trailingSpaces) ||
|
||||
(strict &&
|
||||
(!includesSorted(paragraphLineNumbers, lineNumber) ||
|
||||
includesSorted(codeInlineLineNumbers, lineNumber)))
|
||||
)
|
||||
) {
|
||||
const column = line.length - trailingSpaces + 1;
|
||||
addError(
|
||||
onError,
|
||||
lineNumber,
|
||||
"Expected: " + (expected === 0 ? "" : "0 or ") +
|
||||
expected + "; Actual: " + trailingSpaces,
|
||||
null,
|
||||
[ column, trailingSpaces ],
|
||||
{
|
||||
"editColumn": column,
|
||||
"deleteCount": trailingSpaces
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue