From 336fee4c94f4c637842f54a55d772c7f9b62e524 Mon Sep 17 00:00:00 2001 From: Josh Willox Date: Sun, 28 Jul 2024 14:11:48 +1000 Subject: [PATCH] refactor: use default prettier config --- .prettierrc.yaml | 1 - src/canary-card.ts | 2 +- src/main.ts | 4 ++-- src/secondary-info.ts | 4 ++-- 4 files changed, 5 insertions(+), 6 deletions(-) delete mode 100644 .prettierrc.yaml diff --git a/.prettierrc.yaml b/.prettierrc.yaml deleted file mode 100644 index 96c43624..00000000 --- a/.prettierrc.yaml +++ /dev/null @@ -1 +0,0 @@ -arrowParens: avoid diff --git a/src/canary-card.ts b/src/canary-card.ts index 9f0ed6bd..15492fac 100644 --- a/src/canary-card.ts +++ b/src/canary-card.ts @@ -80,7 +80,7 @@ export class CanaryCard extends LitElement implements LovelaceCard { (async () => { while (customElements.get("home-assistant") === undefined) - await new Promise(resolve => window.setTimeout(resolve, 100)); + await new Promise((resolve) => window.setTimeout(resolve, 100)); if (!customElements.get("canary-card")) { customElements.define("canary-card", CanaryCard); diff --git a/src/main.ts b/src/main.ts index f58eecaa..cc97cc87 100644 --- a/src/main.ts +++ b/src/main.ts @@ -21,7 +21,7 @@ function getResources() { const retVal: string[] = []; for (const script of scriptElements) { if (script?.innerText?.trim()?.startsWith("import(")) { - const imports = script.innerText.split("\n")?.map(e => e.trim()); + const imports = script.innerText.split("\n")?.map((e) => e.trim()); for (const imp of imports) { retVal.push(imp.replace(/^import\("/, "").replace(/"\);/, "")); } @@ -31,7 +31,7 @@ function getResources() { } const resources = getResources(); -if (resources.some(r => r.endsWith(name + ".js"))) { +if (resources.some((r) => r.endsWith(name + ".js"))) { console.info(`${name} is loaded as a module`); } else { fireEvent(window, "ll-rebuild", {}); diff --git a/src/secondary-info.ts b/src/secondary-info.ts index e84ebbc5..8f2a9bfd 100644 --- a/src/secondary-info.ts +++ b/src/secondary-info.ts @@ -131,7 +131,7 @@ class SecondaryInfo extends HTMLElement { _shouldUpdate(newHass, entities) { if (!this._hass || !entities) return true; return entities.some( - entity => newHass.states[entity] !== this._hass?.states[entity], + (entity) => newHass.states[entity] !== this._hass?.states[entity], ); } @@ -147,7 +147,7 @@ class SecondaryInfo extends HTMLElement { // show loading message if this is the first connection. this._unsubRenderTemplate = subscribeRenderTemplate( null, - result => { + (result) => { this._element && (this._element.innerHTML = result); }, this._data,