From c31199fd2475be3b7c4bfd52e365c90860dcb338 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Tue, 12 Dec 2023 01:05:10 +0000 Subject: [PATCH] chore(deps): update dependency eslint-config-standard-with-typescript to v42 --- package.json | 2 +- src/action-handler-directive.ts | 14 ++++---------- src/clock-weather-card.ts | 10 ++++++---- yarn.lock | 8 ++++---- 4 files changed, 15 insertions(+), 19 deletions(-) diff --git a/package.json b/package.json index 766cc070..d09ad280 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "@typescript-eslint/eslint-plugin": "^6.4.0", "@typescript-eslint/parser": "^6.0.0", "eslint": "^8.0.1", - "eslint-config-standard-with-typescript": "^40.0.0", + "eslint-config-standard-with-typescript": "^42.0.0", "eslint-plugin-import": "^2.25.2", "eslint-plugin-n": "^15.0.0 || ^16.0.0 ", "eslint-plugin-promise": "^6.0.0", diff --git a/src/action-handler-directive.ts b/src/action-handler-directive.ts index beaf76ca..b55ba647 100644 --- a/src/action-handler-directive.ts +++ b/src/action-handler-directive.ts @@ -83,15 +83,8 @@ class ActionHandler extends HTMLElement implements ActionHandler { const start = (ev: Event): void => { this.held = false - let x - let y - if ((ev as TouchEvent).touches) { - x = (ev as TouchEvent).touches[0].pageX - y = (ev as TouchEvent).touches[0].pageY - } else { - x = (ev as MouseEvent).pageX - y = (ev as MouseEvent).pageY - } + const x = (ev as MouseEvent).pageX ?? (ev as TouchEvent).touches[0].pageX + const y = (ev as MouseEvent).pageY ?? (ev as TouchEvent).touches[0].pageY this.timer = window.setTimeout(() => { this.startAnimation(x, y) @@ -166,7 +159,8 @@ customElements.define('action-handler-clock-weather', ActionHandler) const getActionHandler = (): ActionHandler => { const body = document.body if (body.querySelector('action-handler-clock-weather')) { - return body.querySelector('action-handler-clock-weather') as ActionHandler + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + return body.querySelector('action-handler-clock-weather')! } const actionhandler = document.createElement('action-handler-clock-weather') diff --git a/src/clock-weather-card.ts b/src/clock-weather-card.ts index 78e91761..ffa1035c 100644 --- a/src/clock-weather-card.ts +++ b/src/clock-weather-card.ts @@ -7,7 +7,8 @@ import { hasAction, type ActionHandlerEvent, handleAction, - TimeFormat + TimeFormat, + type ActionConfig } from 'custom-card-helpers' // This is a community maintained npm module with common helper functions/types. https://github.com/custom-cards/custom-card-helpers import { @@ -153,8 +154,8 @@ export class ClockWeatherCard extends LitElement { { this.handleAction(e) }} .actionHandler=${actionHandler({ - hasHold: hasAction(this.config.hold_action), - hasDoubleClick: hasAction(this.config.double_tap_action) + hasHold: hasAction(this.config.hold_action as ActionConfig | undefined), + hasDoubleClick: hasAction(this.config.double_tap_action as ActionConfig | undefined) })} tabindex="0" .label=${`Clock Weather Card: ${this.config.entity || 'No Entity Defined'}`} @@ -340,7 +341,8 @@ export class ClockWeatherCard extends LitElement { const maxVal = Math.min(roundUp(maxTempCelsius, 10), max([...gradientMap.keys()])) return Array.from(gradientMap.keys()) .filter((temp) => temp >= minVal && temp <= maxVal) - .map((temp) => gradientMap.get(temp) as Rgb) + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + .map((temp) => gradientMap.get(temp)!) } private gradient (rgbs: Rgb[], fromPercent: number, toPercent: number): string { diff --git a/yarn.lock b/yarn.lock index d4d2a0ae..66438cec 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1138,10 +1138,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-standard-with-typescript@^40.0.0: - version "40.0.0" - resolved "https://registry.yarnpkg.com/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-40.0.0.tgz#6501601dc35e378e6b16e22257e80b7bd276119d" - integrity sha512-GXUJcwIXiTQaS3H4etv8a1lejVVdZYaxZNz3g7vt6GoJosQqMTurbmSC4FVGyHiGT/d1TjFr3+47A3xsHhsG+Q== +eslint-config-standard-with-typescript@^42.0.0: + version "42.0.0" + resolved "https://registry.yarnpkg.com/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-42.0.0.tgz#19e8fb3d996701328230cf735ee86dbfb8e8e352" + integrity sha512-m1/2g/Sicun1uFZOFigJVeOqo9fE7OkMsNtilcpHwdCdcGr21qsGqYiyxYSvvHfJwY7w5OTQH0hxk8sM2N5Ohg== dependencies: "@typescript-eslint/parser" "^6.4.0" eslint-config-standard "17.1.0"