From 83ba66afa48037221766989e0d9e85e8cea5e80d Mon Sep 17 00:00:00 2001 From: Geoff Doty Date: Thu, 27 Mar 2025 12:27:49 -0500 Subject: [PATCH] linting --- src/Mite.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Mite.js b/src/Mite.js index acb00f6..e7b49f5 100644 --- a/src/Mite.js +++ b/src/Mite.js @@ -22,7 +22,7 @@ export class Mite { if (!this.root) throw new Error(`Element ${selector} not found`); this.state = {}; - for (let key in options.state) { + for (const key in options.state) { this.state[key] = signal(options.state[key]); } @@ -32,8 +32,8 @@ export class Mite { unmounted: options.unmounted || (() => {}) }; - for (let key in this.methods) { - if (typeof this.methods[key] === 'function') { + for (const key in this.methods) { + if (typeof this.methods[key] === "function") { this.methods[key] = this.methods[key].bind(this); } } @@ -55,7 +55,7 @@ export class Mite { this.scanAndBind(this.root); - for (let key in this.state) { + for (const key in this.state) { this.update(key); } } @@ -78,7 +78,7 @@ export class Mite { }); } } else if (node.nodeType === Node.ELEMENT_NODE) { - for (let attr of node.attributes) { + for (const attr of node.attributes) { const matches = attr.value.match(/{(\w+)}/g); if (matches) { if (attr.name.startsWith('@')) { @@ -181,8 +181,8 @@ export class Mite { binding.node.style.display = this.state[key].value ? '' : 'none'; break; - case 'each': - let parent = this.root.querySelector(binding.parentSelector); + case 'each': { + const parent = this.root.querySelector(binding.parentSelector); if (!parent) { console.error(`Parent node (${binding.parentSelector}) not found for r-each="${binding.originalReach}"`); return; @@ -223,6 +223,7 @@ export class Mite { parent.appendChild(clone); }); break; + } } }); }