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:
David Anson 2022-06-08 22:10:27 -07:00
parent 15efcb4282
commit b6471fba31
34 changed files with 414 additions and 389 deletions

View file

@ -12,9 +12,9 @@ module.exports = {
"Consider starting bulleted lists at the beginning of the line",
"tags": [ "bullet", "ul", "indentation" ],
"function": function MD006(params, onError) {
flattenedLists().forEach((list) => {
for (const list of flattenedLists()) {
if (list.unordered && !list.nesting && (list.indent !== 0)) {
list.items.forEach((item) => {
for (const item of list.items) {
const { lineNumber, line } = item;
addErrorDetailIf(
onError,
@ -27,8 +27,8 @@ module.exports = {
{
"deleteCount": line.length - line.trimStart().length
});
});
}
}
});
}
}
};