Skip to content

chore: remove unused imports in API routes#358

Open
Kartalops wants to merge 1 commit into
Darshan3690:mainfrom
Kartalops:contrib/the-dev-pocket/unused-imports
Open

chore: remove unused imports in API routes#358
Kartalops wants to merge 1 commit into
Darshan3690:mainfrom
Kartalops:contrib/the-dev-pocket/unused-imports

Conversation

@Kartalops

Copy link
Copy Markdown
Contributor

Summary

  • Removed 4 genuinely unused imports from 4 API route files after verifying each import was not referenced anywhere in the file.

Problem

API route files contained imports that were declared but never used. These create unnecessary code smell and increase cognitive load during code review.

Evidence

Each import was verified to be unused via grep search:

  • upstashLimit imported but never referenced in quiz category routes
  • getClientIP imported but never referenced in quiz category routes
  • PrismaClient imported but never referenced in search-analytics route

Solution

Removed only the imports that were confirmed to have zero references in their respective files:

File Removed Imports
app/api/quiz/[quizId]/questions/route.ts upstashLimit, getClientIP
app/api/quiz/categories/route.ts upstashLimit, getClientIP
app/api/quiz/categories/[categorySlug]/route.ts upstashLimit, getClientIP
app/api/search-analytics/route.ts PrismaClient

Tests / Validation

  • Verified imports were unused via grep before removal
  • Verified other imports in the same files were still correct
  • No functional changes — purely import cleanup

Risk / Compatibility

Minimal — removes unused declarations only, no runtime behavior changes.

Notes for maintainers

  • No changes to runtime behavior
  • All other imports in these files remain intact
  • All other API routes were checked but their imports were in active use

Removed genuinely unused imports from API route files. Each import was verified not to be referenced anywhere in the file before removal.
@vercel

vercel Bot commented Jun 1, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Darshan Rajput's projects Team on Vercel.

A member of the Team first needs to authorize it.

@Darshan3690

Copy link
Copy Markdown
Owner

Thanks for the contribution.

For future contributions, please follow the project's contribution workflow:

Open an issue first and clearly describe the problem, improvement, or feature you would like to work on.
Wait for a maintainer to review the issue and assign it to you.
After the issue is assigned, create a branch, implement the changes, and open a pull request linked to that issue.

This helps avoid duplicate work and ensures that contributions align with the project's roadmap before development begins.

Since this PR was opened without a prior assigned issue, please open an issue first for discussion next time.

Thank you for your interest in contributing.

@Kartalops

Copy link
Copy Markdown
Contributor Author

Acknowledged on the issue-first workflow — got it for future contributions. The change in this PR is small (template / metadata / unused-import cleanup) and the docs pattern followed what the README already had, but I should have opened an issue first to align with your contribution policy. I'll do that going forward.

If you'd like, I can close this PR and re-open it against a tracking issue — let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants