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
|
|
@ -14,9 +14,9 @@ module.exports = {
|
|||
const indent = Number(params.config.indent || 2);
|
||||
const startIndented = !!params.config.start_indented;
|
||||
const startIndent = Number(params.config.start_indent || indent);
|
||||
flattenedLists().forEach((list) => {
|
||||
for (const list of flattenedLists()) {
|
||||
if (list.unordered && list.parentsUnordered) {
|
||||
list.items.forEach((item) => {
|
||||
for (const item of list.items) {
|
||||
const { lineNumber, line } = item;
|
||||
const expectedIndent =
|
||||
(startIndented ? startIndent : 0) +
|
||||
|
|
@ -42,8 +42,8 @@ module.exports = {
|
|||
"deleteCount": actualIndent,
|
||||
"insertText": "".padEnd(expectedIndent)
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue