Update MD004/ul-style to auto-fix violations (fixes #351).

This commit is contained in:
David Anson 2021-02-06 15:49:02 -08:00
parent 5aef3a4a51
commit ed325ebb56
8 changed files with 113 additions and 37 deletions

View file

@ -723,8 +723,9 @@ module.exports.applyFixes = function applyFixes(input, errors) {
const editIndex = editColumn - 1;
if (
(lineIndex !== lastLineIndex) ||
((editIndex + deleteCount) < lastEditIndex) ||
(deleteCount === -1)
(deleteCount === -1) ||
((editIndex + deleteCount) <=
(lastEditIndex - ((deleteCount > 0) ? 0 : 1)))
) {
lines[lineIndex] = applyFix(lines[lineIndex], fixInfo, lineEnding);
}