From 3669f943a44817d126f5d296c2861c16fc1e592d Mon Sep 17 00:00:00 2001 From: Claude Date: Thu, 21 May 2026 19:23:30 +0000 Subject: [PATCH] chore: remove unused variables flagged by eslint Clear all 22 no-unused-vars warnings: drop unused imports, unused route handler request params, and unused catch bindings. Also removes the dead, uncalled rateLimit.check mock export. https://claude.ai/code/session_01YFnkjNWLYpJR12r4HLGsvK --- web/src/app/api/context/qa/route.ts | 2 -- web/src/app/api/insights/code-quality/route.ts | 2 +- web/src/app/api/insights/trends/route.ts | 2 +- web/src/app/api/integrations/jira/issues/route.ts | 2 +- web/src/app/api/integrations/knowledge/pages/route.ts | 2 +- web/src/app/api/integrations/linear/issues/route.ts | 2 +- web/src/app/api/team/communication/notifications/route.ts | 4 +--- web/src/app/api/team/contributions/route.ts | 2 +- web/src/app/api/team/knowledge-heatmap/route.ts | 2 +- web/src/app/api/team/productivity/route.ts | 2 +- web/src/components/ActivityTrendsPanel.tsx | 6 +----- web/src/components/IntegrationsPanel.tsx | 2 +- web/src/components/KnowledgeHeatmapPanel.tsx | 4 ++-- web/src/components/LinearIssuesPanel.tsx | 3 +-- web/src/components/TeamCommunicationPanel.tsx | 2 +- web/src/lib/rateLimit.ts | 6 ------ 16 files changed, 15 insertions(+), 30 deletions(-) diff --git a/web/src/app/api/context/qa/route.ts b/web/src/app/api/context/qa/route.ts index 583a8dd..4a61f9d 100644 --- a/web/src/app/api/context/qa/route.ts +++ b/web/src/app/api/context/qa/route.ts @@ -28,8 +28,6 @@ export async function POST(request: NextRequest) { ); } - const lastMessage = messages[messages.length - 1]; - // Fetch recent context const recentActivities: Activity[] = await prisma.activity.findMany({ orderBy: { timestamp: "desc" }, diff --git a/web/src/app/api/insights/code-quality/route.ts b/web/src/app/api/insights/code-quality/route.ts index 713bd3e..51941eb 100644 --- a/web/src/app/api/insights/code-quality/route.ts +++ b/web/src/app/api/insights/code-quality/route.ts @@ -5,7 +5,7 @@ import { withRateLimit } from "@/lib/rateLimit"; const prisma = new PrismaClient(); -export const GET = withRateLimit(async (request: Request) => { +export const GET = withRateLimit(async () => { try { // In a real implementation, this would analyze static analysis reports or complex git churn metrics. // For now, we simulate detection based on "high churn" files that might indicate instability. diff --git a/web/src/app/api/insights/trends/route.ts b/web/src/app/api/insights/trends/route.ts index c826854..99da77b 100644 --- a/web/src/app/api/insights/trends/route.ts +++ b/web/src/app/api/insights/trends/route.ts @@ -2,7 +2,7 @@ import { NextResponse } from "next/server"; import { PrismaClient } from "@prisma/client"; import { withRateLimit } from "@/lib/rateLimit"; -import { startOfDay, subDays, format } from "date-fns"; +import { subDays, format } from "date-fns"; const prisma = new PrismaClient(); diff --git a/web/src/app/api/integrations/jira/issues/route.ts b/web/src/app/api/integrations/jira/issues/route.ts index 310b25d..a76e4f1 100644 --- a/web/src/app/api/integrations/jira/issues/route.ts +++ b/web/src/app/api/integrations/jira/issues/route.ts @@ -29,7 +29,7 @@ const generateMockIssues = (count: number): JiraIssue[] => { })); }; -export const GET = withRateLimit(async (request: Request) => { +export const GET = withRateLimit(async () => { try { // In a real implementation: // 1. Fetch JIRA_BASE_URL and JIRA_API_TOKEN from env/DB diff --git a/web/src/app/api/integrations/knowledge/pages/route.ts b/web/src/app/api/integrations/knowledge/pages/route.ts index 94c1386..b1ff728 100644 --- a/web/src/app/api/integrations/knowledge/pages/route.ts +++ b/web/src/app/api/integrations/knowledge/pages/route.ts @@ -31,7 +31,7 @@ const generateMockPages = (count: number): KnowledgePage[] => { })).sort((a, b) => new Date(b.lastEdited).getTime() - new Date(a.lastEdited).getTime()); }; -export const GET = withRateLimit(async (request: Request) => { +export const GET = withRateLimit(async () => { try { // Check configuration const notionConfigured = !!process.env.NOTION_API_KEY; diff --git a/web/src/app/api/integrations/linear/issues/route.ts b/web/src/app/api/integrations/linear/issues/route.ts index bae70b2..a5c8322 100644 --- a/web/src/app/api/integrations/linear/issues/route.ts +++ b/web/src/app/api/integrations/linear/issues/route.ts @@ -43,7 +43,7 @@ const generateMockIssues = (count: number): LinearIssue[] => { }).sort((a, b) => new Date(b.updated).getTime() - new Date(a.updated).getTime()); }; -export const GET = withRateLimit(async (request: Request) => { +export const GET = withRateLimit(async () => { try { const isConfigured = !!process.env.LINEAR_API_KEY; const issues = generateMockIssues(6); diff --git a/web/src/app/api/team/communication/notifications/route.ts b/web/src/app/api/team/communication/notifications/route.ts index a25ac95..9e9693f 100644 --- a/web/src/app/api/team/communication/notifications/route.ts +++ b/web/src/app/api/team/communication/notifications/route.ts @@ -1,7 +1,5 @@ import { NextResponse } from "next/server"; -import { prisma } from "@/lib/prisma"; -import { subDays } from "date-fns"; import { withRateLimit } from "@/lib/rateLimit"; // Mock data generator for demo purposes since we don't have real Slack/Discord tokens configured yet @@ -22,7 +20,7 @@ const generateMockNotifications = (count: number) => { })).sort((a, b) => new Date(b.timestamp).getTime() - new Date(a.timestamp).getTime()); }; -export const GET = withRateLimit(async (request: Request) => { +export const GET = withRateLimit(async () => { try { // In a real implementation, this would query: // 1. Internal notification table diff --git a/web/src/app/api/team/contributions/route.ts b/web/src/app/api/team/contributions/route.ts index ffa614b..712d78e 100644 --- a/web/src/app/api/team/contributions/route.ts +++ b/web/src/app/api/team/contributions/route.ts @@ -53,7 +53,7 @@ export const GET = withRateLimit(async (request: Request) => { try { const meta = (typeof a.metadata === 'string' ? JSON.parse(a.metadata) : a.metadata) as ActivityMetadata; file = meta?.file || meta?.filePath; - } catch (e) { + } catch { // ignore parse error } diff --git a/web/src/app/api/team/knowledge-heatmap/route.ts b/web/src/app/api/team/knowledge-heatmap/route.ts index fb2ae83..c576d66 100644 --- a/web/src/app/api/team/knowledge-heatmap/route.ts +++ b/web/src/app/api/team/knowledge-heatmap/route.ts @@ -39,7 +39,7 @@ export const GET = withRateLimit(async (request: Request) => { try { const meta = typeof a.metadata === 'string' ? JSON.parse(a.metadata) : a.metadata; file = meta?.file || meta?.filePath; - } catch (e) { + } catch { // ignore } diff --git a/web/src/app/api/team/productivity/route.ts b/web/src/app/api/team/productivity/route.ts index 785eced..7f96138 100644 --- a/web/src/app/api/team/productivity/route.ts +++ b/web/src/app/api/team/productivity/route.ts @@ -1,6 +1,6 @@ import { NextResponse } from "next/server"; import { prisma } from "@/lib/prisma"; -import { subDays, startOfDay, format, differenceInMinutes } from "date-fns"; +import { subDays, format, differenceInMinutes } from "date-fns"; import { withRateLimit } from "@/lib/rateLimit"; export const GET = withRateLimit(async (request: Request) => { diff --git a/web/src/components/ActivityTrendsPanel.tsx b/web/src/components/ActivityTrendsPanel.tsx index 4b7b9a1..a398b4b 100644 --- a/web/src/components/ActivityTrendsPanel.tsx +++ b/web/src/components/ActivityTrendsPanel.tsx @@ -1,7 +1,7 @@ "use client"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { TrendingUp, Activity } from "lucide-react"; +import { TrendingUp } from "lucide-react"; import useSWR from "swr"; import { format, parseISO } from "date-fns"; @@ -50,10 +50,6 @@ export function ActivityTrendsPanel() { const trends: TrendPoint[] = data?.trends || []; const maxCount = Math.max(...trends.map((t) => t.count), 1); - // SVG Chart Dimensions - const height = 160; - const width = 100; // percent - // Calculate points for SVG polyline const points = trends .map((point, index) => { diff --git a/web/src/components/IntegrationsPanel.tsx b/web/src/components/IntegrationsPanel.tsx index 817b7ca..f2d9832 100644 --- a/web/src/components/IntegrationsPanel.tsx +++ b/web/src/components/IntegrationsPanel.tsx @@ -2,7 +2,7 @@ "use client"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { Link2, Github, Gitlab, Slack, Trello, CheckCircle2, XCircle, AlertCircle, Plug } from "lucide-react"; +import { Link2, Github, Gitlab, Slack, Trello, CheckCircle2, XCircle, Plug } from "lucide-react"; import useSWR from "swr"; interface Integration { diff --git a/web/src/components/KnowledgeHeatmapPanel.tsx b/web/src/components/KnowledgeHeatmapPanel.tsx index 44258df..88b2fea 100644 --- a/web/src/components/KnowledgeHeatmapPanel.tsx +++ b/web/src/components/KnowledgeHeatmapPanel.tsx @@ -2,7 +2,7 @@ "use client"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; -import { Grid3X3, Users, Info, AlertCircle } from "lucide-react"; +import { Grid3X3, Users, AlertCircle } from "lucide-react"; import useSWR from "swr"; interface HeatmapEntry { @@ -98,7 +98,7 @@ export function KnowledgeHeatmapPanel() {
- {entry.contributors.slice(0, 3).map((name, i) => ( + {entry.contributors.slice(0, 3).map((name) => (
{ - return true; // Always allow in mock - }, -};