Closed klebba closed 7 months ago
@theengineear how do you recommend I address the no-loop-func
violation? I could ignore it or rework it (could use your help with that)
Can you just change that find
function from:
const find = path => {
let node = content;
for (const index of path) {
node = Template.#setIfMissing(lookup, node, () => node.childNodes)[index];
}
return node;
};
to
const find = path => {
let node = content;
for (const index of path) {
const ref = node;
node = Template.#setIfMissing(lookup, node, () => ref.childNodes)[index];
}
return node;
};
The rule is just complaining about the fact that I’ve referenced something in a callback where the reference may change by the time it’s called back. It’s a fair warning 🤷
Thanks for the explainer! Fixt.
One new violation: