Upgrade packages and delete dead code#13
Conversation
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
…knip configuration Co-authored-by: Copilot <copilot@github.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
|
Warning Rate limit exceeded
To keep reviews running without waiting, you can enable usage-based add-on for your organization. This allows additional reviews beyond the hourly cap. Account admins can enable it under billing. ⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughAdds Knip unused-code checks to CI and pre-commit; introduces Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Review rate limit: 0/1 reviews remaining, refill in 53 minutes and 58 seconds.Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (3)
knip.json (2)
6-18: Blanket-ignoringsrc/components/ui/*guts the new Knip gate.This excludes the shared UI layer from unused-export and dependency analysis, so dead code in files like
src/components/ui/sidebar.tsxwill never be reported. Prefer narrower per-file ignores or tagged suppressions for known false positives.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@knip.json` around lines 6 - 18, Remove the blanket ignore for "src/components/ui/*" in the knip.json ignore array so the Knip gate can analyze the shared UI layer (e.g., files like src/components/ui/sidebar.tsx); instead, add narrower ignores for specific files that are known false positives or add in-file tagged suppressions/comments for those exact files, keeping the rest of src/components/ui/ under Knip analysis to catch dead exports and dependency issues.
19-29: Remove@trpc/react-queryfromignoreDependenciessince it has no imports in the codebase.The codebase uses
@trpc/tanstack-react-query,@trpc/client, and@trpc/server. A search confirms@trpc/react-queryis only listed inpackage.jsonas a declared dependency and inknip.jsonas a suppression—but nowhere is it actually imported. Keeping it inignoreDependenciesmasks this dead dependency instead of letting Knip detect it.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@knip.json` around lines 19 - 29, Remove the "@trpc/react-query" entry from the "ignoreDependencies" array in knip.json so Knip can detect it as an unused/dead dependency; locate the "ignoreDependencies" array (the list containing "@next/third-parties", "@tanstack/query-async-storage-persister", etc.) and delete the "@trpc/react-query" item, then re-run Knip to confirm it flags the unused dependency for removal from package.json.tsconfig.json (1)
29-30: Scope Bun types to Bun-only entrypoints.Adding
"types": ["bun"]to the roottsconfig.jsonmakes Bun globals available in every.ts/.tsxfile, which is unnecessarily broad. Although Bun-specific APIs are not currently used in app code, this scope expands the type environment for all files. Use a dedicatedtsconfigfor Bun scripts or per-file Bun type references instead.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@tsconfig.json` around lines 29 - 30, Remove the broad "types": ["bun"] setting from the root tsconfig.json so Bun globals are not injected into every TS/TSX file; instead add a dedicated tsconfig (e.g., tsconfig.bun.json) that extends the root and contains "types": ["bun"] for Bun-only scripts, or add per-file triple-slash references (/// <reference types="bun" />) at the top of Bun entrypoints; update any Bun-specific build/test scripts to use the new tsconfig.bun.json or the per-file references and ensure the root tsconfig.json no longer contains the "types": ["bun"] entry.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@knip.json`:
- Around line 6-18: Remove the blanket ignore for "src/components/ui/*" in the
knip.json ignore array so the Knip gate can analyze the shared UI layer (e.g.,
files like src/components/ui/sidebar.tsx); instead, add narrower ignores for
specific files that are known false positives or add in-file tagged
suppressions/comments for those exact files, keeping the rest of
src/components/ui/ under Knip analysis to catch dead exports and dependency
issues.
- Around line 19-29: Remove the "@trpc/react-query" entry from the
"ignoreDependencies" array in knip.json so Knip can detect it as an unused/dead
dependency; locate the "ignoreDependencies" array (the list containing
"@next/third-parties", "@tanstack/query-async-storage-persister", etc.) and
delete the "@trpc/react-query" item, then re-run Knip to confirm it flags the
unused dependency for removal from package.json.
In `@tsconfig.json`:
- Around line 29-30: Remove the broad "types": ["bun"] setting from the root
tsconfig.json so Bun globals are not injected into every TS/TSX file; instead
add a dedicated tsconfig (e.g., tsconfig.bun.json) that extends the root and
contains "types": ["bun"] for Bun-only scripts, or add per-file triple-slash
references (/// <reference types="bun" />) at the top of Bun entrypoints; update
any Bun-specific build/test scripts to use the new tsconfig.bun.json or the
per-file references and ensure the root tsconfig.json no longer contains the
"types": ["bun"] entry.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 36aea508-4516-4532-8752-38bade2e290b
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (7)
.github/workflows/build.yml.husky/pre-commitbiome.jsonknip.jsonpackage.jsonsrc/components/ui/sidebar.tsxtsconfig.json
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
next.config.mjs (1)
6-6: Add validation forEXPORT_MODEto fail fast on invalid values.Passing raw env input to the
outputfield risks silent config errors. While Next.js validates the config and logs warnings, explicit validation upfront prevents unexpected behavior across environments.Proposed validation
import NextBundleAnalyzer from '@next/bundle-analyzer'; /** `@type` {import('next').NextConfig} */ +const exportMode = process.env.EXPORT_MODE; +if (exportMode && exportMode !== 'standalone' && exportMode !== 'export') { + throw new Error("Invalid EXPORT_MODE. Use 'standalone' or 'export'."); +} + const nextConfig = { // Use `bun run build:standalone` if you are using Docker - output: process.env.EXPORT_MODE, + output: exportMode, turbopack: { root: import.meta.dirname, }, reactCompiler: true, };🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@next.config.mjs` at line 6, The current next.config.mjs assigns process.env.EXPORT_MODE directly to the Next.js config output field which can mask bad env values; update next.config.mjs to validate EXPORT_MODE before exporting the config: read and normalize process.env.EXPORT_MODE (trim and toLowerCase), check it against an explicit allowed set (e.g., "standalone", "export", "server" or whatever your app supports), and if it's missing or not in the allowed set throw a clear Error that fails fast with guidance on acceptable values; if you want a default, explicitly set a documented default (e.g., "standalone") instead of passing the raw env through.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/components/notifications/notification-menu.tsx`:
- Around line 18-25: The PopoverTrigger (containing the Bell icon) lacks an
accessible name when notifications.length === 0; add an aria-label (or
aria-labelledby) prop on PopoverTrigger to provide a clear name (e.g.,
"Notifications" and optionally include the unread count when
notifications.length > 0). Update the PopoverTrigger element in
notification-menu.tsx (the element wrapping Bell) to always supply this
accessible name so screen readers can announce the control even when the visual
label is absent.
---
Nitpick comments:
In `@next.config.mjs`:
- Line 6: The current next.config.mjs assigns process.env.EXPORT_MODE directly
to the Next.js config output field which can mask bad env values; update
next.config.mjs to validate EXPORT_MODE before exporting the config: read and
normalize process.env.EXPORT_MODE (trim and toLowerCase), check it against an
explicit allowed set (e.g., "standalone", "export", "server" or whatever your
app supports), and if it's missing or not in the allowed set throw a clear Error
that fails fast with guidance on acceptable values; if you want a default,
explicitly set a documented default (e.g., "standalone") instead of passing the
raw env through.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: 26c8aac3-c7db-4dc5-aa1c-7f7a7244f082
⛔ Files ignored due to path filters (1)
bun.lockis excluded by!**/*.lock
📒 Files selected for processing (6)
knip.jsonnext.config.mjspackage.jsonsrc/components/auth/signout-button.tsxsrc/components/notifications/notification-menu.tsxsrc/lib/auth-client.ts
💤 Files with no reviewable changes (1)
- src/components/auth/signout-button.tsx
✅ Files skipped from review due to trivial changes (1)
- knip.json
| <PopoverTrigger | ||
| className={cn( | ||
| buttonVariants({ variant: "ghost", size: "icon" }), | ||
| "relative rounded-full" | ||
| )} | ||
| > | ||
| <Bell size={22} /> | ||
| {notifications.length > 0 && ( |
There was a problem hiding this comment.
Add an accessible name to the trigger button (Line 18).
When unread count is 0, this becomes effectively icon-only and may have no clear accessible name for screen readers.
♿ Suggested fix
<PopoverTrigger
+ aria-label={
+ notifications.length > 0
+ ? `Open notifications (${notifications.length} unread)`
+ : "Open notifications"
+ }
className={cn(
buttonVariants({ variant: "ghost", size: "icon" }),
"relative rounded-full"
)}
>📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| <PopoverTrigger | |
| className={cn( | |
| buttonVariants({ variant: "ghost", size: "icon" }), | |
| "relative rounded-full" | |
| )} | |
| > | |
| <Bell size={22} /> | |
| {notifications.length > 0 && ( | |
| <PopoverTrigger | |
| aria-label={ | |
| notifications.length > 0 | |
| ? `Open notifications (${notifications.length} unread)` | |
| : "Open notifications" | |
| } | |
| className={cn( | |
| buttonVariants({ variant: "ghost", size: "icon" }), | |
| "relative rounded-full" | |
| )} | |
| > | |
| <Bell size={22} /> | |
| {notifications.length > 0 && ( |
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In `@src/components/notifications/notification-menu.tsx` around lines 18 - 25, The
PopoverTrigger (containing the Bell icon) lacks an accessible name when
notifications.length === 0; add an aria-label (or aria-labelledby) prop on
PopoverTrigger to provide a clear name (e.g., "Notifications" and optionally
include the unread count when notifications.length > 0). Update the
PopoverTrigger element in notification-menu.tsx (the element wrapping Bell) to
always supply this accessible name so screen readers can announce the control
even when the visual label is absent.
|



Summary by CodeRabbit
Chores
UI