mirror of
https://github.com/DavidAnson/markdownlint.git
synced 2025-12-17 22:40:13 +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
|
|
@ -11,7 +11,7 @@ module.exports = {
|
|||
"description": "Dollar signs used before commands without showing output",
|
||||
"tags": [ "code" ],
|
||||
"function": function MD014(params, onError) {
|
||||
[ "code_block", "fence" ].forEach((type) => {
|
||||
for (const type of [ "code_block", "fence" ]) {
|
||||
filterTokens(params, type, (token) => {
|
||||
const margin = (token.type === "fence") ? 1 : 0;
|
||||
const dollarInstances = [];
|
||||
|
|
@ -31,7 +31,7 @@ module.exports = {
|
|||
}
|
||||
}
|
||||
if (allDollars) {
|
||||
dollarInstances.forEach((instance) => {
|
||||
for (const instance of dollarInstances) {
|
||||
const [ i, lineTrim, column, length ] = instance;
|
||||
addErrorContext(
|
||||
onError,
|
||||
|
|
@ -45,9 +45,9 @@ module.exports = {
|
|||
"deleteCount": length
|
||||
}
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue