Skip to content

Commit 53905a4

Browse files
FezVrastaclaude
andcommitted
fix(lint): resolve all biome lint errors
- Replace 'any' casts with proper Window interface types for setHass - Add biome-ignore suppression on the correct forEach callback for noExcessiveCognitiveComplexity Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 7a5d608 commit 53905a4

File tree

4 files changed

+7
-3
lines changed

4 files changed

+7
-3
lines changed

packages/frontend/src/main.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ function renderApp() {
7575
};
7676

7777
// Expose setHass to the parent window (panel-wrapper.ts)
78-
(window as any).setHass = (newHass: HomeAssistant) => {
78+
window.setHass = (newHass: HomeAssistant | undefined) => {
7979
render(newHass);
8080
};
8181

packages/frontend/src/panel-wrapper.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ declare const window: Window & {
1010
hass?: HomeAssistant;
1111
};
1212

13+
1314
class CafePanelWrapper extends HTMLElement {
1415
private _messageHandler?: (event: MessageEvent) => void;
1516
private iframe: HTMLIFrameElement | null = null;
@@ -22,8 +23,9 @@ class CafePanelWrapper extends HTMLElement {
2223
window.hass = value;
2324

2425
// Notify the iframe of the update if it has registered a listener
25-
if (this.iframe?.contentWindow && (this.iframe.contentWindow as any).setHass) {
26-
(this.iframe.contentWindow as any).setHass(value);
26+
const iframeWindow = this.iframe?.contentWindow as (Window & typeof globalThis) | null;
27+
if (iframeWindow?.setHass) {
28+
iframeWindow.setHass(value);
2729
}
2830
}
2931

packages/frontend/src/types/global.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { HomeAssistant } from './hass';
33
declare global {
44
interface Window {
55
hass?: HomeAssistant;
6+
setHass?: (hass: HomeAssistant | undefined) => void;
67
cafeNarrow?: boolean;
78
cafeRoute?: unknown;
89
cafePanel?: unknown;

packages/transpiler/src/parser/YamlParser.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1111,6 +1111,7 @@ export class YamlParser {
11111111
}
11121112
};
11131113

1114+
// biome-ignore lint/complexity/noExcessiveCognitiveComplexity: large dispatch switch, refactoring deferred
11141115
actions.forEach((action, index) => {
11151116
if (!action || typeof action !== 'object') {
11161117
// Unknown action type - create unknown node

0 commit comments

Comments
 (0)