mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-18 06:50:12 +01:00
Enable ESLint rule unicorn/no-array-for-each, auto-fix all violations, manually address new issues for ~4% time reduction measured via profile-fixture.mjs on Apple Silicon M1.
This commit is contained in:
parent
15efcb4282
commit
b6471fba31
34 changed files with 414 additions and 389 deletions
|
|
@ -14,13 +14,13 @@ module.exports = {
|
|||
const olSingle = Number(params.config.ol_single || 1);
|
||||
const ulMulti = Number(params.config.ul_multi || 1);
|
||||
const olMulti = Number(params.config.ol_multi || 1);
|
||||
flattenedLists().forEach((list) => {
|
||||
for (const list of flattenedLists()) {
|
||||
const lineCount = list.lastLineIndex - list.open.map[0];
|
||||
const allSingle = lineCount === list.items.length;
|
||||
const expectedSpaces = list.unordered ?
|
||||
(allSingle ? ulSingle : ulMulti) :
|
||||
(allSingle ? olSingle : olMulti);
|
||||
list.items.forEach((item) => {
|
||||
for (const item of list.items) {
|
||||
const { line, lineNumber } = item;
|
||||
const match = /^[\s>]*\S+(\s*)/.exec(line);
|
||||
const [ { "length": matchLength }, { "length": actualSpaces } ] = match;
|
||||
|
|
@ -44,7 +44,7 @@ module.exports = {
|
|||
fixInfo
|
||||
);
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue