Skip to content

Commit 4ea96df

Browse files
ambvclaude
andcommitted
Fix ESLint errors in page components
Remove unused imports and variables. Drop bindings from catch clauses. Use const where variables are never reassigned. Remove unused map callback parameters. Escape apostrophes in JSX text. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 801c9bb commit 4ea96df

File tree

7 files changed

+15
-31
lines changed

7 files changed

+15
-31
lines changed

frontend/src/app/about/page.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ export default function AboutPage() {
5656
try {
5757
const users = await api.getMaintainers();
5858
setAdminUsers(users.filter((user) => user.is_active));
59-
} catch (error) {
59+
} catch {
6060
// Fallback to hardcoded admin if API fails
6161
setAdminUsers([
6262
{
@@ -248,7 +248,7 @@ export default function AboutPage() {
248248
</CardHeader>
249249
<CardContent>
250250
<p className="text-muted-foreground">
251-
Powered by Memray's flamegraph generation, explore exactly where
251+
Powered by Memray&apos;s flamegraph generation, explore exactly where
252252
memory is allocated in the CPython codebase. Click through call
253253
stacks, zoom into specific functions, and identify memory
254254
hotspots.
@@ -265,7 +265,7 @@ export default function AboutPage() {
265265
</CardHeader>
266266
<CardContent>
267267
<p className="text-muted-foreground">
268-
Access memory profiling data for any commit in CPython's
268+
Access memory profiling data for any commit in CPython&apos;s
269269
history. Compare commits across weeks, months, or years to
270270
understand long-term memory usage trends and validate that
271271
optimizations have lasting impact.
@@ -331,7 +331,7 @@ export default function AboutPage() {
331331
<CardContent className="prose prose-lg prose-neutral dark:prose-invert max-w-none text-center">
332332
<p>
333333
CPython Memory Insights is built on top of <strong>Memray</strong>,
334-
Bloomberg's powerful memory profiler for Python. Memray provides the
334+
Bloomberg&apos;s powerful memory profiler for Python. Memray provides the
335335
core profiling capabilities that enable tracking memory allocations
336336
with minimal overhead and generate detailed flamegraphs for
337337
analysis.
@@ -358,7 +358,7 @@ export default function AboutPage() {
358358
</CardTitle>
359359
</CardHeader>
360360
<CardContent className="space-y-4">
361-
{faqItems.map((item, index) => (
361+
{faqItems.map((item) => (
362362
<Collapsible
363363
key={item.question}
364364
open={openFAQ === item.question}

frontend/src/app/binaries/[id]/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ interface EnvironmentCardProps {
6868
}
6969

7070
function EnvironmentCard({
71-
binary,
71+
binary: _binary,
7272
binaryId,
7373
environment,
7474
commits,

frontend/src/app/build-comparison/page.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ import type {
5858
import { METRIC_OPTIONS } from '@/lib/types';
5959
import { api } from '@/lib/api';
6060
import { ScrollArea } from '@/components/ui/scroll-area';
61-
import { Badge } from '@/components/ui/badge';
6261
import { Slider } from '@/components/ui/slider';
6362
import { useToast } from '@/hooks/use-toast';
6463

@@ -279,7 +278,7 @@ export default function BuildComparisonPage() {
279278

280279
for (const [key, trends] of Object.entries(batchResponse.results)) {
281280
// Extract binary ID and benchmark name from key: format is "binaryId:benchmarkName|pythonVersion"
282-
let benchmarkPart = key.split('|')[0]; // Remove python version part
281+
const benchmarkPart = key.split('|')[0]; // Remove python version part
283282
const [binaryId, benchmarkName] = benchmarkPart.split(':'); // Extract binary ID and benchmark name
284283
if (!newTrendData[binaryId]) {
285284
newTrendData[binaryId] = {};
@@ -310,7 +309,7 @@ export default function BuildComparisonPage() {
310309
debouncedMaxDataPoints,
311310
]); // Remove selectedBenchmarks and benchmarkMode from dependencies
312311

313-
const filteredData = useMemo(() => {
312+
useMemo(() => {
314313
// For "All Benchmarks" mode, don't require selectedBenchmarks
315314
const requiresBenchmarkSelection =
316315
benchmarkMode === 'specific' && selectedBenchmarks.length === 0;
@@ -1009,7 +1008,7 @@ export default function BuildComparisonPage() {
10091008
default_benchᵢ) × 100%]) / n_benchmarks
10101009
</div>
10111010
<div className="text-xs text-muted-foreground">
1012-
Each benchmark's % change vs Default is calculated, then
1011+
Each benchmark&apos;s % change vs Default is calculated, then
10131012
averaged across all selected benchmarks. 0% = same as
10141013
default, positive = uses more memory, negative = uses less
10151014
memory.

frontend/src/app/diff/page.tsx

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,10 @@ import {
4545
} from 'lucide-react';
4646
import { useRouter } from 'next/navigation';
4747
import type {
48-
DiffTableRow,
49-
MetricKey,
5048
Commit,
5149
Binary,
5250
Environment,
5351
} from '@/lib/types';
54-
import { METRIC_OPTIONS } from '@/lib/types';
5552
import { api } from '@/lib/api';
5653
import type { DiffQueryParams } from '@/types/api';
5754
import { useSearchParams } from 'next/navigation';
@@ -335,14 +332,14 @@ function DiffTableContent() {
335332
environment_id: selectedEnvironmentId,
336333
metric_key: 'high_watermark_bytes',
337334
} satisfies DiffQueryParams;
338-
335+
339336
const totalAllocatedParams = {
340337
commit_sha: selectedCommitSha,
341338
binary_id: selectedBinaryId,
342339
environment_id: selectedEnvironmentId,
343340
metric_key: 'total_allocated_bytes',
344341
} satisfies DiffQueryParams;
345-
342+
346343
const [highWatermarkData, totalAllocatedData] = await Promise.all([
347344
api.getDiffTable(highWatermarkParams),
348345
api.getDiffTable(totalAllocatedParams),
@@ -544,10 +541,6 @@ function DiffTableContent() {
544541
return 'text-foreground';
545542
};
546543

547-
const getPythonVersionDisplay = (versionStr?: string) => {
548-
return versionStr ? `(py ${versionStr})` : '';
549-
};
550-
551544
if (!mounted || loading) {
552545
return (
553546
<div className="space-y-6">

frontend/src/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export default function Home() {
110110
<div className="w-full max-w-6xl">
111111
{/* First row - 3 cards */}
112112
<div className="grid grid-cols-1 md:grid-cols-3 gap-6 mb-6">
113-
{features.slice(0, 3).map((feature, index) => (
113+
{features.slice(0, 3).map((feature) => (
114114
<Card
115115
key={feature.title}
116116
className="flex flex-col shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1 group"
@@ -138,7 +138,7 @@ export default function Home() {
138138

139139
{/* Second row - 3 cards */}
140140
<div className="grid grid-cols-1 md:grid-cols-3 gap-6">
141-
{features.slice(3).map((feature, index) => (
141+
{features.slice(3).map((feature) => (
142142
<Card
143143
key={feature.title}
144144
className="flex flex-col shadow-lg hover:shadow-xl transition-all duration-300 hover:-translate-y-1 group"

frontend/src/app/trends/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ export default function BenchmarkTrendPage() {
310310

311311
for (const [key, trends] of Object.entries(batchResponse.results)) {
312312
// Extract benchmark name from key: format is "binaryId:benchmarkName|pythonVersion"
313-
let benchmarkPart = key.split('|')[0]; // Remove python version part
313+
const benchmarkPart = key.split('|')[0]; // Remove python version part
314314
const [, benchmarkName] = benchmarkPart.split(':'); // Extract benchmark name
315315
newTrendData[benchmarkName] = trends;
316316
}

frontend/src/app/version-comparison/page.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,22 +28,15 @@ import { Button } from '@/components/ui/button';
2828
import { Checkbox } from '@/components/ui/checkbox';
2929
import { Label } from '@/components/ui/label';
3030
import {
31-
Tooltip,
32-
TooltipContent,
3331
TooltipProvider,
34-
TooltipTrigger,
3532
} from '@/components/ui/tooltip';
3633
import {
3734
GitBranch,
3835
Download,
3936
ArrowUpDown,
4037
Filter,
4138
AlertCircle,
42-
Info,
43-
Code2,
44-
BarChart3,
4539
} from 'lucide-react';
46-
import { useRouter } from 'next/navigation';
4740
import type { Commit, Binary, Environment } from '@/lib/types';
4841
import type {
4942
TrendDataPoint,
@@ -72,7 +65,6 @@ type SortField = 'benchmark_name';
7265
type SortDirection = 'asc' | 'dsc';
7366

7467
function VersionComparisonContent() {
75-
const router = useRouter();
7668
const [commits, setCommits] = useState<Commit[]>([]);
7769
const [binaries, setBinaries] = useState<Binary[]>([]);
7870
const [environments, setEnvironments] = useState<Environment[]>([]);
@@ -618,7 +610,7 @@ function VersionComparisonContent() {
618610
</Label>
619611
<p className="text-sm text-muted-foreground">
620612
Choose which Python versions to include in the comparison
621-
(maximum 5). We'll use the latest commit for each version.
613+
(maximum 5). We&apos;ll use the latest commit for each version.
622614
</p>
623615
</div>
624616
<div className="flex items-center gap-2 mt-3 lg:mt-0">

0 commit comments

Comments
 (0)