mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +01:00
Remove trimLeft/trimRight helpers; use native implementations.
This commit is contained in:
parent
22c36c388f
commit
73511ff677
4 changed files with 7 additions and 46 deletions
|
|
@ -2,8 +2,8 @@
|
|||
|
||||
"use strict";
|
||||
|
||||
const { addError, filterTokens, forEachLine, includesSorted, rangeFromRegExp,
|
||||
trimRight } = require("../helpers");
|
||||
const { addError, filterTokens, forEachLine, includesSorted, rangeFromRegExp } =
|
||||
require("../helpers");
|
||||
const { lineMetadata } = require("./cache");
|
||||
|
||||
const trailingSpaceRe = /\s+$/;
|
||||
|
|
@ -34,7 +34,7 @@ module.exports = {
|
|||
const lineNumber = lineIndex + 1;
|
||||
if (trailingSpaceRe.test(line) &&
|
||||
!includesSorted(listItemLineNumbers, lineNumber)) {
|
||||
const actual = line.length - trimRight(line).length;
|
||||
const actual = line.length - line.trimRight().length;
|
||||
if (expected !== actual) {
|
||||
addError(onError, lineNumber,
|
||||
"Expected: " + (expected === 0 ? "" : "0 or ") +
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue