Skip to content

Commit

Permalink
chore(deps): update dependency eslint-config-standard-with-typescript…
Browse files Browse the repository at this point in the history
… to v42
  • Loading branch information
renovate[bot] authored and pkissling committed Dec 12, 2023
1 parent 285e7e1 commit c31199f
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
14 changes: 4 additions & 10 deletions src/action-handler-directive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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')
Expand Down
10 changes: 6 additions & 4 deletions src/clock-weather-card.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -153,8 +154,8 @@ export class ClockWeatherCard extends LitElement {
<ha-card
@action=${(e: ActionHandlerEvent) => { 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'}`}
Expand Down Expand Up @@ -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 {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit c31199f

Please sign in to comment.