Skip to content

Commit 8143ecc

Browse files
committed
fix: fixed lint errors
1 parent 7a60b4c commit 8143ecc

2 files changed

Lines changed: 11 additions & 8 deletions

File tree

src/routes/admin/attendance/apprentices/+page.svelte

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import { resolve } from '$app/paths';
33
import { goto } from '$app/navigation';
44
import { navigating } from '$app/state';
5-
import { SvelteSet } from 'svelte/reactivity';
5+
import { SvelteSet, SvelteMap } from 'svelte/reactivity';
66
import type { ApprenticeAttendanceStats } from '$lib/types/attendance';
77
import type { Cohort } from '$lib/airtable/sveltekit-wrapper';
88
@@ -17,7 +17,7 @@
1717
1818
// Group cohorts by prefix and sort
1919
const groupedCohorts = $derived.by(() => {
20-
const groups = new Map<string, Cohort[]>();
20+
const groups = new SvelteMap<string, Cohort[]>();
2121
2222
for (const cohort of cohorts) {
2323
// For MLX cohorts, group them all under "MLX"
@@ -27,7 +27,8 @@
2727
groups.set(mlxKey, []);
2828
}
2929
groups.get(mlxKey)!.push(cohort);
30-
} else {
30+
}
31+
else {
3132
// Extract prefix (e.g., "FAC29" from "FAC29.2")
3233
const prefix = cohort.name.match(/^([A-Z]+\d*)/)?.[1] || cohort.name;
3334
@@ -63,7 +64,7 @@
6364
})
6465
.map(([prefix, cohorts]) => ({
6566
prefix,
66-
cohorts: cohorts.sort((a, b) => a.name.localeCompare(b.name))
67+
cohorts: cohorts.sort((a, b) => a.name.localeCompare(b.name)),
6768
}));
6869
});
6970
@@ -138,7 +139,8 @@
138139
if (allSelected) {
139140
// Deselect all in group
140141
groupCohortIds.forEach(id => localSelectedCohorts.delete(id));
141-
} else {
142+
}
143+
else {
142144
// Select all in group
143145
groupCohortIds.forEach(id => localSelectedCohorts.add(id));
144146
}

src/routes/checkin/+page.svelte

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@
55
66
let { data }: { data: PageData } = $props();
77
8-
// Make events reactive
9-
let events = $state(data.events);
8+
// Make events reactive - need $state for mutation in event handlers
9+
// eslint-disable-next-line svelte/prefer-writable-derived
10+
let events = $state<typeof data.events>([]);
1011
1112
// Update events when data changes (page navigation)
1213
$effect(() => {
13-
events = data.events;
14+
events = [...data.events];
1415
});
1516
1617
// Check-in state for authenticated users

0 commit comments

Comments
 (0)