Reimplement MD009/no-trailing-spaces using micromark tokens.

This commit is contained in:
David Anson 2024-08-12 23:24:32 -07:00
parent 37ab4a0faf
commit 4072cf7417
7 changed files with 380 additions and 116 deletions

View file

@ -169,17 +169,6 @@ function isBlankLine(line) {
}
module.exports.isBlankLine = isBlankLine;
/**
* Compare function for Array.prototype.sort for ascending order of numbers.
*
* @param {number} a First number.
* @param {number} b Second number.
* @returns {number} Positive value if a>b, negative value if b<a, 0 otherwise.
*/
module.exports.numericSortAscending = function numericSortAscending(a, b) {
return a - b;
};
// Returns true iff the sorted array contains the specified element
module.exports.includesSorted = function includesSorted(array, element) {
let left = 0;