Skip to content

Commit 801c9bb

Browse files
ambvclaude
andcommitted
Fix ESLint errors in admin components
Remove unused imports. Drop bindings from catch clauses where the error variable was unused. Remove dead API_BASE assignments. Replace require() calls with dynamic import() in QueryConsole. Escape apostrophes in JSX text. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 8a02be6 commit 801c9bb

File tree

8 files changed

+145
-162
lines changed

8 files changed

+145
-162
lines changed

frontend/src/app/admin/components/AdminUsersManager.tsx

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,10 @@ import {
3636
User,
3737
Calendar,
3838
UserCheck,
39-
AlertTriangle,
4039
Shield,
41-
Crown,
4240
} from 'lucide-react';
4341
import { api } from '@/lib/api';
44-
import type { AdminUserResponse, AdminUserCreate } from '@/lib/types';
42+
import type { AdminUserResponse } from '@/lib/types';
4543

4644
export default function AdminUsersManager() {
4745
const [users, setUsers] = useState<AdminUserResponse[]>([]);
@@ -89,7 +87,7 @@ export default function AdminUsersManager() {
8987
github_username: newUser.github_username.trim(),
9088
notes: newUser.notes.trim() || undefined,
9189
});
92-
90+
9391
setUsers((prev) => [...prev, createdUser]);
9492
setNewUser({ github_username: '', notes: '' });
9593
setDialogOpen(false);

frontend/src/app/admin/components/BenchmarkResultsManager.tsx

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,13 @@ import {
2323
} from '@/components/ui/dialog';
2424
import { Checkbox } from '@/components/ui/checkbox';
2525
import { useToast } from '@/hooks/use-toast';
26-
import {
27-
BarChart3,
28-
Edit,
29-
Trash2,
30-
Search,
31-
Eye,
26+
import {
27+
BarChart3,
28+
Edit,
29+
Trash2,
30+
Search,
3231
Flame,
3332
Database,
34-
CheckSquare,
35-
Square
3633
} from 'lucide-react';
3734
import { api } from '@/lib/api';
3835
import type { BenchmarkResultResponse, BenchmarkResultUpdate } from '@/lib/types';
@@ -83,7 +80,7 @@ export default function BenchmarkResultsManager() {
8380
if (filters.max_memory) params.max_memory = parseInt(filters.max_memory);
8481

8582
const apiResults = await api.getAdminBenchmarkResults(params);
86-
83+
8784
// Map API response to component's expected format
8885
const mappedResults: BenchmarkResultResponse[] = apiResults.map(result => ({
8986
id: result.id,
@@ -95,7 +92,7 @@ export default function BenchmarkResultsManager() {
9592
top_allocating_functions: result.top_allocating_functions,
9693
has_flamegraph: result.has_flamegraph,
9794
}));
98-
95+
9996
setResults(mappedResults);
10097
} catch (error) {
10198
console.error('Error loading benchmark results:', error);
@@ -384,7 +381,7 @@ export default function BenchmarkResultsManager() {
384381
</CardHeader>
385382
</Card>
386383
)}
387-
384+
388385
<div className="space-y-4">
389386
{results.map((result) => (
390387
<Card
@@ -396,7 +393,7 @@ export default function BenchmarkResultsManager() {
396393
<div className="flex items-center space-x-3">
397394
<Checkbox
398395
checked={selectedResults.has(result.id)}
399-
onCheckedChange={(checked) =>
396+
onCheckedChange={(checked) =>
400397
handleSelectResult(result.id, checked as boolean)
401398
}
402399
/>
@@ -434,7 +431,7 @@ export default function BenchmarkResultsManager() {
434431
</DialogHeader>
435432
<div className="overflow-auto">
436433
{flamegraphHtml && (
437-
<div
434+
<div
438435
dangerouslySetInnerHTML={{ __html: flamegraphHtml }}
439436
className="w-full"
440437
/>
@@ -470,7 +467,7 @@ export default function BenchmarkResultsManager() {
470467
className="font-mono"
471468
/>
472469
</div>
473-
470+
474471
<div>
475472
<Label htmlFor="edit-high-watermark">High Watermark (bytes)</Label>
476473
<Input
@@ -513,7 +510,7 @@ export default function BenchmarkResultsManager() {
513510
...prev,
514511
allocation_histogram: parsed,
515512
}));
516-
} catch (error) {
513+
} catch {
517514
// Invalid JSON, ignore
518515
}
519516
}}
@@ -534,7 +531,7 @@ export default function BenchmarkResultsManager() {
534531
...prev,
535532
top_allocating_functions: parsed,
536533
}));
537-
} catch (error) {
534+
} catch {
538535
// Invalid JSON, ignore
539536
}
540537
}}
@@ -666,4 +663,4 @@ export default function BenchmarkResultsManager() {
666663
)}
667664
</div>
668665
);
669-
}
666+
}

frontend/src/app/admin/components/BinariesManager.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import { Input } from '@/components/ui/input';
1313
import { Label } from '@/components/ui/label';
1414
import { Textarea } from '@/components/ui/textarea';
1515
import { Badge } from '@/components/ui/badge';
16-
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs';
1716
import {
1817
Dialog,
1918
DialogContent,
@@ -62,7 +61,7 @@ export default function BinariesManager() {
6261
try {
6362
const data = await api.getAdminBinaries();
6463
setBinaries(data);
65-
} catch (error) {
64+
} catch {
6665
toast({
6766
title: 'Error',
6867
description: 'Failed to load binaries',
@@ -95,7 +94,7 @@ export default function BinariesManager() {
9594
} else {
9695
await api.createBinary(binaryData);
9796
}
98-
97+
9998
await loadBinaries();
10099
setIsDialogOpen(false);
101100
resetForm();

frontend/src/app/admin/components/EnvironmentsManager.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ export default function EnvironmentsManager() {
5555
try {
5656
const data = await api.getAdminEnvironments();
5757
setEnvironments(data);
58-
} catch (error) {
58+
} catch {
5959
toast({
6060
title: 'Error',
6161
description: 'Failed to load environments',
@@ -81,7 +81,7 @@ export default function EnvironmentsManager() {
8181
} else {
8282
await api.createEnvironment(environmentData);
8383
}
84-
84+
8585
await loadEnvironments();
8686
setIsDialogOpen(false);
8787
resetForm();

frontend/src/app/admin/components/MemrayFailuresManager.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,6 @@ export default function MemrayFailuresManager() {
4545
const [deleting, setDeleting] = useState<number | null>(null);
4646
const { toast } = useToast();
4747

48-
const API_BASE = process.env.NEXT_PUBLIC_API_BASE || 'http://localhost:8000';
49-
5048
useEffect(() => {
5149
loadData();
5250
}, []);
@@ -217,4 +215,4 @@ export default function MemrayFailuresManager() {
217215

218216
</div>
219217
);
220-
}
218+
}

0 commit comments

Comments
 (0)