🎨 Lint project

This commit is contained in:
Rune Harlyk
2025-10-11 10:54:07 +02:00
parent 91a7b170fe
commit a77eb0b1e0
36 changed files with 77 additions and 72 deletions
+4 -3
View File
@@ -83,7 +83,7 @@
telemetry.setRSSI(0)
}
const handleError = (data: any) => console.error(data)
const handleError = (data: unknown) => console.error(data)
const handleAnalytics = (data: Analytics) => analytics.addData(data)
@@ -115,13 +115,14 @@
</div>
<Modals>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<!-- svelte-ignore a11y_no_static_element_interactions -->
{#snippet backdrop()}
<div
class="fixed inset-0 z-40 max-h-full max-w-full bg-black/20 backdrop-blur-sm"
transition:fade
onclick={modals.closeAll}
onkeydown={e => e.key === 'Escape' && modals.closeAll()}
role="button"
tabindex="0"
></div>
{/snippet}
</Modals>
+2 -3
View File
@@ -9,7 +9,6 @@
modes,
type Modes,
ModesEnum,
walkGaits,
WalkGaits,
walkGait,
walkGaitLabels
@@ -61,9 +60,9 @@
})
left.on('move', (_, data) => handleJoyMove('left', data.vector))
left.on('end', (_, __) => handleJoyMove('left', { x: 0, y: 0 }))
left.on('end', () => handleJoyMove('left', { x: 0, y: 0 }))
right.on('move', (_, data) => handleJoyMove('right', data.vector))
right.on('end', (_, __) => handleJoyMove('right', { x: 0, y: 0 }))
right.on('end', () => handleJoyMove('right', { x: 0, y: 0 }))
})
const handleJoyMove = (key: 'left' | 'right', data: vector) => {
@@ -25,7 +25,7 @@
{#await getCameraSettings()}
<Spinner />
{:then _}
{:then}
<div class="flex flex-col gap-1">
<button class="btn btn-primary" type="button" onclick={updateCameraSettings}
>Update camera settings</button
+1 -1
View File
@@ -30,7 +30,7 @@
return () => socket.off(MessageTopic.i2cScan, handleScan)
})
const handleScan = (data: any) => {
const handleScan = (data: { addresses: number[] }) => {
active_devices = data.addresses.map(
(address: number) =>
i2cDevices.find(device => device.address === address) || {
@@ -15,7 +15,7 @@
return () => socket.off(MessageTopic.peripheralSettings, handleSettings)
})
const handleSettings = (data: any) => {
const handleSettings = (data: Record<string, unknown>) => {
settings = data
}
+1 -1
View File
@@ -173,7 +173,7 @@
})
}
const updateChartData = (chart: Chart, data: number[], label: string) => {
const updateChartData = (chart: Chart, data: number[]) => {
chart.data.labels = data
chart.data.datasets[0].data = data
chart.options.scales!.y!.min = Math.min(...data) - 1
@@ -3,7 +3,7 @@
import { onMount } from 'svelte'
import { RotateCw, RotateCcw } from '$lib/components/icons'
interface Props {
data?: any
data?: Record<string, unknown>
servoId?: number
pwm?: number
}
@@ -1,5 +1,4 @@
<script lang="ts">
import SettingsCard from '$lib/components/SettingsCard.svelte'
import Spinner from '$lib/components/Spinner.svelte'
import Folder from './Folder.svelte'
import { api } from '$lib/api'
@@ -164,7 +163,7 @@
{#await getContent(filename)}
<Spinner />
{:then _}
{:then}
{#if isEditing}
<textarea
class="w-full h-[300px] sm:h-[500px] font-mono p-2 bg-gray-800 text-white"
@@ -6,7 +6,7 @@
interface Props {
expanded?: boolean
name: string
files: any
files: unknown[]
selected: (name: string) => void
onDelete: (name: string) => void
}
@@ -1,6 +1,5 @@
<script lang="ts">
import { onMount } from 'svelte'
import { page } from '$app/stores'
import SettingsCard from '$lib/components/SettingsCard.svelte'
import { slide } from 'svelte/transition'
import { cubicOut } from 'svelte/easing'
@@ -1,5 +1,6 @@
<script lang="ts">
import { onDestroy, onMount } from 'svelte'
import type { ComponentType } from 'svelte'
import { modals } from 'svelte-modals'
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte'
import SettingsCard from '$lib/components/SettingsCard.svelte'
@@ -110,7 +111,7 @@
}
interface ActionButtonDef {
icon: any
icon: ComponentType
label: string
onClick: () => void
type?: string
@@ -28,7 +28,10 @@
console.error('Error:', result.inner)
return
}
return result.inner as any
return result.inner as {
tag_name: string
assets: Array<{ name: string; browser_download_url: string }>
}
}
async function postGithubDownload(url: string) {
@@ -39,7 +42,7 @@
}
}
function confirmGithubUpdate(assets: any) {
function confirmGithubUpdate(assets: Array<{ name: string; browser_download_url: string }>) {
let url = ''
// iterate over assets and find the correct one
for (let i = 0; i < assets.length; i++) {
@@ -154,7 +157,7 @@
</table>
</div>
</div>
{:catch error}
{:catch}
<div class="alert alert-error shadow-lg">
<Error class="h-6 w-6 shrink-0" />
<span
+1 -1
View File
@@ -16,7 +16,7 @@
let apSettings: ApSettings | null = $state(null)
let apStatus: ApStatus | null = $state(null)
let formField: any = $state()
let formField: Record<string, unknown> = $state()
async function getAPStatus() {
const result = await api.get<ApStatus>('/api/wifi/ap/status')
-1
View File
@@ -3,7 +3,6 @@
import { api } from '$lib/api'
import SettingsCard from '$lib/components/SettingsCard.svelte'
import { AP, Home, MAC, Devices } from '$lib/components/icons'
import Spinner from '$lib/components/Spinner.svelte'
import StatusItem from '$lib/components/StatusItem.svelte'
import { cubicOut } from 'svelte/easing'
import { slide } from 'svelte/transition'
+1 -1
View File
@@ -87,7 +87,7 @@
</div>
{:else}
<ul class="menu">
{#each listOfNetworks as network, i}
{#each listOfNetworks as network}
<li>
<!-- svelte-ignore a11y_click_events_have_key_events -->
<div
+1 -1
View File
@@ -63,7 +63,7 @@
let showWifiDetails = $state(false)
let formField: any = $state()
let formField: Record<string, unknown> = $state()
let formErrors = $state({
ssid: false,