Skip to content

Commit 53edd4d

Browse files
committed
fix: resolve biome check failures
1 parent a006bad commit 53edd4d

12 files changed

Lines changed: 29 additions & 28 deletions

File tree

src/app/components/ui/sidebar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ function SidebarProvider({
7070
_setOpen(openState);
7171
}
7272

73-
// This sets the cookie to keep the sidebar state.
73+
// biome-ignore lint/suspicious/noDocumentCookie: Cookie persistence is used to preserve sidebar state between reloads.
7474
document.cookie = `${SIDEBAR_COOKIE_NAME}=${openState}; path=/; max-age=${SIDEBAR_COOKIE_MAX_AGE}`;
7575
},
7676
[setOpenProp, open]

src/app/contexts/theme-context.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
* Updated to use Zustand for state management with localStorage persistence
44
*/
55
import { createContext, type ReactNode, useContext, useMemo } from 'react';
6-
import { shallow } from 'zustand/shallow';
76
import { useThemeStore } from '../stores/theme-store';
87

98
export type ThemeType = 'dark' | 'light' | 'contrast';

src/app/features/dashboard/components/widgets/photo-frame-widget.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ export function PhotoFrameWidget({ size = 'large' }: PhotoFrameWidgetProps) {
2222
const bgColor =
2323
theme === 'light' ? 'bg-white/70' : theme === 'contrast' ? 'bg-black/50' : 'bg-white/10';
2424
const textPrimary = theme === 'light' ? 'text-gray-900' : 'text-white';
25-
const textSecondary =
26-
theme === 'light' ? 'text-gray-600' : theme === 'contrast' ? 'text-gray-300' : 'text-gray-400';
2725
const border = theme === 'light' ? 'border-gray-200/50' : 'border-white/10';
2826

2927
const getColorValue = (color: string) => {

src/app/features/rss/components/RSSFeedCardContainer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import type { CardSize } from '@/app/components/shared/card-size-selector';
21
import { memo } from 'react';
2+
import type { CardSize } from '@/app/components/shared/card-size-selector';
33
import { useTheme } from '../../../contexts/theme-context';
44
import { RSSFeedCardView } from './RSSFeedCardView';
55

src/app/features/sensors/components/SensorGroupSettingsContainer.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import * as Dialog from '@radix-ui/react-dialog';
2-
import type { LucideIcon } from 'lucide-react';
32
import { memo, useCallback, useRef, useState } from 'react';
43
import { CustomScrollbar } from '../../shared/components/custom-scrollbar';
5-
import { iconMap, type SensorIconType } from './sensors/sensor-types';
64
import { SensorGroupSettingsView } from './SensorGroupSettingsView';
5+
import { iconMap, type SensorIconType } from './sensors/sensor-types';
76

87
interface SensorReading {
98
label: string;

src/app/features/sensors/components/sensor-group-settings-dialog.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import * as Dialog from '@radix-ui/react-dialog';
2-
import type { LucideIcon } from 'lucide-react';
32
import { Plus, Search, Trash2, X } from 'lucide-react';
43
import { memo, useCallback, useRef, useState } from 'react';
54
import { CustomScrollbar } from '@/app/components/shared/custom-scrollbar';

src/app/features/settings/components/settings-section.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import { Switch } from '@/app/components/ui/switch';
1818
import { useAuth } from '@/app/contexts/auth-context';
1919
import { useConfig } from '@/app/contexts/config-context';
2020
import { type ThemeType, useTheme } from '@/app/contexts/theme-context';
21-
import { useSettingsStore, type PrimaryColor } from '@/app/stores';
21+
import { type PrimaryColor, useSettingsStore } from '@/app/stores';
2222

2323
export function SettingsSection() {
2424
const { theme, setTheme, primaryColor, setPrimaryColor, wallpaper, setWallpaper } = useTheme();

src/app/hooks/use-card-ordering.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ export const useCardOrdering = (
5656
.flat()
5757
.map((d) => d.id)
5858
);
59-
customCards.forEach((card) => allDeviceIds.add(card.id));
59+
customCards.forEach((card) => {
60+
allDeviceIds.add(card.id);
61+
});
6062
const isValid = Object.values(parsed).every(
6163
(orderArray: unknown) =>
6264
Array.isArray(orderArray) &&
@@ -79,7 +81,9 @@ export const useCardOrdering = (
7981
.flat()
8082
.map((device) => device.id)
8183
);
82-
customCards.forEach((card) => allDeviceIds.add(card.id));
84+
customCards.forEach((card) => {
85+
allDeviceIds.add(card.id);
86+
});
8387

8488
setCardOrders((prev) => {
8589
const next = buildOrders();

src/app/hooks/use-ha-devices.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import { useHomeAssistantContext } from '../contexts/home-assistant-context';
44
import type {
55
ClimateDevice,
66
CoverDevice,
7-
DeviceMetric,
87
DeviceCollection,
8+
DeviceMetric,
99
LightDevice,
1010
LockDevice,
1111
PersonDevice,
@@ -454,7 +454,7 @@ export const useHADevices = (): DeviceCollection => {
454454
});
455455
break;
456456

457-
case 'switch':
457+
case 'switch': {
458458
const entityEntry = entityRegistryMap.get(entityId);
459459
const deviceMetrics = entityEntry?.device_id
460460
? switchMetricsByDeviceId.get(entityEntry.device_id)
@@ -484,6 +484,7 @@ export const useHADevices = (): DeviceCollection => {
484484
metrics: deviceMetrics,
485485
});
486486
break;
487+
}
487488

488489
case 'climate':
489490
climate.push({

src/app/services/device.service.ts

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,24 @@
1-
import type { DeviceCollection, DeviceWithType } from '../types/device.types';
1+
import type { Device, DeviceCollection, DeviceWithType } from '../types/device.types';
22

33
/**
44
* Device Service
55
* Handles all device data operations
66
* In production, this would make API calls
77
*/
88
class DeviceService {
9+
private withType(device: Device, type: keyof DeviceCollection): DeviceWithType {
10+
return { ...device, type } as DeviceWithType;
11+
}
12+
913
/**
1014
* Create a device map for quick lookups by ID
1115
*/
1216
createDeviceMap(devices: DeviceCollection): Map<string, DeviceWithType> {
1317
const deviceMap = new Map<string, DeviceWithType>();
1418

1519
Object.entries(devices).forEach(([type, deviceArray]) => {
16-
deviceArray.forEach((device: any) => {
17-
deviceMap.set(device.id, { ...device, type: type as keyof DeviceCollection });
20+
deviceArray.forEach((device) => {
21+
deviceMap.set(device.id, this.withType(device, type as keyof DeviceCollection));
1822
});
1923
});
2024

@@ -28,8 +32,8 @@ class DeviceService {
2832
const allDevices: DeviceWithType[] = [];
2933

3034
Object.entries(devices).forEach(([type, deviceArray]) => {
31-
deviceArray.forEach((device: any) => {
32-
const deviceWithType = { ...device, type: type as keyof DeviceCollection };
35+
deviceArray.forEach((device) => {
36+
const deviceWithType = this.withType(device, type as keyof DeviceCollection);
3337

3438
if ('room' in device && device.room === room) {
3539
allDevices.push(deviceWithType);
@@ -49,7 +53,7 @@ class DeviceService {
4953
const roomsSet = new Set<string>();
5054

5155
Object.values(devices).forEach((deviceArray) => {
52-
deviceArray.forEach((device: any) => {
56+
deviceArray.forEach((device) => {
5357
if ('room' in device && device.room) {
5458
roomsSet.add(device.room);
5559
} else if ('location' in device && device.location) {

0 commit comments

Comments
 (0)