🚨 Fix linting errors
This commit is contained in:
@@ -16,7 +16,9 @@ const registerFetchIntercept = async () => {
|
||||
const pathOnly = urlObj.pathname
|
||||
file = await fileService?.getFile(pathOnly)
|
||||
if (file?.isOk() && file.inner) return new Response(new Uint8Array(file.inner))
|
||||
} catch {}
|
||||
} catch {
|
||||
console.error('Failed to get file for ', url)
|
||||
}
|
||||
}
|
||||
|
||||
return originalFetch(resource, config)
|
||||
|
||||
@@ -166,7 +166,7 @@
|
||||
class="flex items-end gap-4 backdrop-blur-sm bg-base-300/60 h-min rounded-tr-2xl pl-0 p-3 border-t border-r border-base-content/5 pointer-events-auto"
|
||||
>
|
||||
<div class="join shadow-lg">
|
||||
{#each modes as modeValue}
|
||||
{#each modes as modeValue (modeValue)}
|
||||
<button
|
||||
class="btn join-item btn-sm transition-all duration-200"
|
||||
class:btn-primary={$mode === modes.indexOf(modeValue)}
|
||||
@@ -179,7 +179,7 @@
|
||||
|
||||
{#if $mode === ModesEnum.Walk}
|
||||
<div class="join shadow-md">
|
||||
{#each Object.values(WalkGaits) as gaitValue}
|
||||
{#each Object.values(WalkGaits) as gaitValue (gaitValue)}
|
||||
{#if typeof gaitValue === 'number'}
|
||||
<button
|
||||
class="btn join-item btn-xs transition-all duration-200"
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
{#if active_devices.length === 0}
|
||||
<div>No I2C devices found</div>
|
||||
{:else}
|
||||
{#each active_devices as device}
|
||||
{#each active_devices as device (device.address)}
|
||||
<div>[{device.address.toString(16)}] {device.part_number} - {device.name}</div>
|
||||
{/each}
|
||||
{/if}
|
||||
|
||||
@@ -252,7 +252,11 @@
|
||||
{/if}
|
||||
</button>
|
||||
{#if calibrationResult}
|
||||
<span class="badge" class:badge-success={calibrationResult.success} class:badge-error={!calibrationResult.success}>
|
||||
<span
|
||||
class="badge"
|
||||
class:badge-success={calibrationResult.success}
|
||||
class:badge-error={!calibrationResult.success}
|
||||
>
|
||||
{calibrationResult.success ? 'Calibrated' : 'Failed'}
|
||||
</span>
|
||||
{/if}
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each data.servos as servo, index}
|
||||
{#each data.servos as servo, index (index)}
|
||||
<tr class="hover:bg-base-200">
|
||||
<td class="font-medium">Servo {index}</td>
|
||||
<td>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
{#if expanded}
|
||||
<ul class="ml-4 border-l border-gray-600 mt-1">
|
||||
{#each Object.entries(files) as [itemName, content]}
|
||||
{#each Object.entries(files) as [itemName, content] (itemName)}
|
||||
<li class="py-1">
|
||||
{#if typeof content === 'object'}
|
||||
<Folder name={itemName} files={content} {selected} {onDelete} />
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<script lang="ts">
|
||||
import { onDestroy, onMount } from 'svelte'
|
||||
import type { ComponentType } from 'svelte'
|
||||
import type { Component } from 'svelte'
|
||||
import { modals } from 'svelte-modals'
|
||||
import ConfirmDialog from '$lib/components/ConfirmDialog.svelte'
|
||||
import SettingsCard from '$lib/components/SettingsCard.svelte'
|
||||
@@ -111,7 +111,7 @@
|
||||
}
|
||||
|
||||
interface ActionButtonDef {
|
||||
icon: ComponentType
|
||||
icon: Component
|
||||
label: string
|
||||
onClick: () => void
|
||||
type?: string
|
||||
@@ -253,7 +253,7 @@
|
||||
</div>
|
||||
|
||||
<div class="mt-4 flex flex-wrap justify-end gap-2">
|
||||
{#each actionButtons as button}
|
||||
{#each actionButtons as button (button.label)}
|
||||
{#if button.condition === undefined || button.condition()}
|
||||
<ActionButton
|
||||
onclick={button.onClick}
|
||||
|
||||
@@ -108,7 +108,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each githubReleases as release}
|
||||
{#each githubReleases as release (release.tag_name)}
|
||||
<tr
|
||||
class={(
|
||||
compareVersions(
|
||||
@@ -119,8 +119,8 @@
|
||||
'bg-primary text-primary-content'
|
||||
: 'bg-base-100 h-14'}
|
||||
>
|
||||
<td align="left" class="text-base font-semibold">
|
||||
<a
|
||||
<td align="left" class="text-base font-semibold"
|
||||
><!-- eslint-disable-next-line svelte/no-navigation-without-resolve -- external URL --><a
|
||||
href={release.html_url}
|
||||
class="link link-hover"
|
||||
target="_blank"
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
<script lang="ts">
|
||||
import { preventDefault } from 'svelte/legacy'
|
||||
|
||||
import { onMount, onDestroy } from 'svelte'
|
||||
import { slide } from 'svelte/transition'
|
||||
import { cubicOut } from 'svelte/easing'
|
||||
@@ -16,7 +14,7 @@
|
||||
let apSettings: ApSettings | null = $state(null)
|
||||
let apStatus: ApStatus | null = $state(null)
|
||||
|
||||
let formField: Record<string, unknown> = $state()
|
||||
let formField: Record<string, unknown> = $state({})
|
||||
|
||||
async function getAPStatus() {
|
||||
const result = await api.get<ApStatus>('/api/wifi/ap/status')
|
||||
@@ -87,7 +85,8 @@
|
||||
apSettings = result.inner
|
||||
}
|
||||
|
||||
function handleSubmitAP() {
|
||||
function handleSubmitAP(e: Event) {
|
||||
e.preventDefault()
|
||||
if (!apSettings) return
|
||||
let valid = true
|
||||
|
||||
@@ -205,7 +204,7 @@
|
||||
>
|
||||
<form
|
||||
class="grid w-full grid-cols-1 content-center gap-x-4 p-0s sm:grid-cols-2"
|
||||
onsubmit={preventDefault(handleSubmitAP)}
|
||||
onsubmit={handleSubmitAP}
|
||||
novalidate
|
||||
bind:this={formField}
|
||||
>
|
||||
@@ -218,7 +217,7 @@
|
||||
id="apmode"
|
||||
bind:value={apSettings.provision_mode}
|
||||
>
|
||||
{#each provisionMode as mode}
|
||||
{#each provisionMode as mode (mode.id)}
|
||||
<option value={mode.id}>
|
||||
{mode.text}
|
||||
</option>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{#each services as service}
|
||||
{#each services as service (service.ip)}
|
||||
<tr>
|
||||
<td><Devices class="h-6 w-6" /></td>
|
||||
<td>{service.name}</td>
|
||||
|
||||
@@ -87,7 +87,7 @@
|
||||
</div>
|
||||
{:else}
|
||||
<ul class="menu">
|
||||
{#each listOfNetworks as network}
|
||||
{#each listOfNetworks as network (network.ssid)}
|
||||
<li>
|
||||
<!-- svelte-ignore a11y_click_events_have_key_events -->
|
||||
<div
|
||||
|
||||
Reference in New Issue
Block a user