diff --git a/package.json b/package.json index 66acebbe3e..67964e7bf3 100644 --- a/package.json +++ b/package.json @@ -227,7 +227,7 @@ "terser-webpack-plugin": "^5.1.1", "ts-lit-plugin": "^1.2.1", "ts-mocha": "^7.0.0", - "typescript": "^4.0.3", + "typescript": "^4.2.4", "vinyl-buffer": "^1.0.1", "vinyl-source-stream": "^2.0.0", "webpack": "^5.24.1", diff --git a/src/cast/receiver_messages.ts b/src/cast/receiver_messages.ts index 460054135d..953d766abd 100644 --- a/src/cast/receiver_messages.ts +++ b/src/cast/receiver_messages.ts @@ -62,7 +62,7 @@ export const ensureConnectedCastSession = (cast: CastManager, auth: Auth) => { return undefined; } - return new Promise((resolve) => { + return new Promise((resolve) => { const unsub = cast.addEventListener("connection-changed", () => { if (cast.castConnectedToOurHass) { unsub(); diff --git a/src/common/util/render-status.ts b/src/common/util/render-status.ts index b51baffce4..c0319c623c 100644 --- a/src/common/util/render-status.ts +++ b/src/common/util/render-status.ts @@ -1,4 +1,4 @@ -export const afterNextRender = (cb: () => void): void => { +export const afterNextRender = (cb: (value: unknown) => void): void => { requestAnimationFrame(() => setTimeout(cb, 0)); }; diff --git a/src/panels/config/cloud/ha-config-cloud.ts b/src/panels/config/cloud/ha-config-cloud.ts index f3ad9778a6..1bf79fac77 100644 --- a/src/panels/config/cloud/ha-config-cloud.ts +++ b/src/panels/config/cloud/ha-config-cloud.ts @@ -73,7 +73,7 @@ class HaConfigCloud extends HassRouterPage { private _resolveCloudStatusLoaded!: () => void; - private _cloudStatusLoaded = new Promise((resolve) => { + private _cloudStatusLoaded = new Promise((resolve) => { this._resolveCloudStatusLoaded = resolve; }); diff --git a/src/panels/config/devices/ha-config-device-page.ts b/src/panels/config/devices/ha-config-device-page.ts index 8b04716baf..187a05f875 100644 --- a/src/panels/config/devices/ha-config-device-page.ts +++ b/src/panels/config/devices/ha-config-device-page.ts @@ -728,7 +728,7 @@ export class HaConfigDevicePage extends LitElement { } if (!newName && !newEntityId) { - return new Promise((resolve) => resolve()); + return undefined; } return updateEntityRegistryEntry(this.hass!, entity.entity_id, { diff --git a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts index 0cf283011e..d2c37635ac 100644 --- a/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts +++ b/src/panels/config/integrations/integration-panels/zha/zha-device-card.ts @@ -159,7 +159,7 @@ class ZHADeviceCard extends SubscribeMixin(LitElement) { } if (!newName && !newEntityId) { - return new Promise((resolve) => resolve()); + return undefined; } return updateEntityRegistryEntry(this.hass!, entity.entity_id, { diff --git a/src/state/haptic-mixin.ts b/src/state/haptic-mixin.ts index 384c31b9a9..6a4483c3bb 100644 --- a/src/state/haptic-mixin.ts +++ b/src/state/haptic-mixin.ts @@ -40,6 +40,7 @@ export const hapticMixin = >(superClass: T) => super.firstUpdated(changedProps); this.addEventListener("hass-vibrate", (ev) => { const vibrate = ev.detail.vibrate; + // @ts-expect-error not all browsers support vibrate if (navigator.vibrate && vibrate) { window.addEventListener("haptic", handleHaptic); } else { @@ -52,6 +53,7 @@ export const hapticMixin = >(superClass: T) => protected hassConnected() { super.hassConnected(); + // @ts-expect-error not all browsers support vibrate if (navigator.vibrate && this.hass!.vibrate) { window.addEventListener("haptic", handleHaptic); } diff --git a/yarn.lock b/yarn.lock index 1c1ffef5e4..5abd1ee959 100644 --- a/yarn.lock +++ b/yarn.lock @@ -13468,10 +13468,10 @@ typescript@^3.8.3: resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.8.3.tgz#409eb8544ea0335711205869ec458ab109ee1061" integrity sha512-MYlEfn5VrLNsgudQTVJeNaQFUAI7DkhnOjdpAp4T+ku1TfQClewlbSuTVHiA+8skNBgaf02TL/kLOvig4y3G8w== -typescript@^4.0.3: - version "4.0.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.0.3.tgz#153bbd468ef07725c1df9c77e8b453f8d36abba5" - integrity sha512-tEu6DGxGgRJPb/mVPIZ48e69xCn2yRmCgYmDugAVwmJ6o+0u1RI18eO7E7WBTLYLaEVVOhwQmcdhQHweux/WPg== +typescript@^4.2.4: + version "4.2.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.2.4.tgz#8610b59747de028fda898a8aef0e103f156d0961" + integrity sha512-V+evlYHZnQkaz8TRBuxTA92yZBPotr5H+WhQ7bD3hZUndx5tGOa1fuCgeSjxAzM1RiN5IzvadIXTVefuuwZCRg== typical@^4.0.0: version "4.0.0"