mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 06:20: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
|
|
@ -18,7 +18,8 @@ module.exports = {
|
|||
"tags": [ "ol" ],
|
||||
"function": function MD029(params, onError) {
|
||||
const style = String(params.config.style || "one_or_ordered");
|
||||
flattenedLists().filter((list) => !list.unordered).forEach((list) => {
|
||||
const filteredLists = flattenedLists().filter((list) => !list.unordered);
|
||||
for (const list of filteredLists) {
|
||||
const { items } = list;
|
||||
let current = 1;
|
||||
let incrementing = false;
|
||||
|
|
@ -49,7 +50,7 @@ module.exports = {
|
|||
current = 1;
|
||||
}
|
||||
// Validate each list item marker
|
||||
items.forEach((item) => {
|
||||
for (const item of items) {
|
||||
const match = orderedListItemMarkerRe.exec(item.line);
|
||||
if (match) {
|
||||
addErrorDetailIf(onError, item.lineNumber,
|
||||
|
|
@ -60,7 +61,7 @@ module.exports = {
|
|||
current++;
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue