Skip to content

refactor(task-board): remove redundant defensive code from useTaskBoardItemPrs - #6985

Open
pedrofrxncx wants to merge 1 commit into
mainfrom
refactor/task-board-prs-hook-cleanup-w3
Open

refactor(task-board): remove redundant defensive code from useTaskBoardItemPrs#6985
pedrofrxncx wants to merge 1 commit into
mainfrom
refactor/task-board-prs-hook-cleanup-w3

Conversation

@pedrofrxncx

@pedrofrxncx pedrofrxncx commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Simplify the initialData function in useTaskBoardItemPrs by removing a redundant no-op fallback. The cast to TaskBoardItemPr[] | undefined already includes undefined as a valid type, making the trailing ?? undefined unnecessary.

Why: Removes unnecessary defensive code, improving code clarity without changing behavior.

Changes: -2 lines in apps/web/src/hooks/use-task-board-item-prs.ts

Verification:

  • bun test apps/web/src/lib/task-board-prs-cache.test.ts — 5 pass
  • bunx oxlint on both files — 0 warnings, 0 errors
  • ✅ Behavior unchanged; cast still safely handles null/undefined

To verify: bun test apps/web/src/lib/task-board-prs-cache.test.ts


Summary by cubic

Removes the redundant ?? undefined fallback in useTaskBoardItemPrs's initialData function. The type cast already includes undefined, so the fallback is a no-op and behavior is unchanged.

Written for commit ae4ff36. Summary will update on new commits.

Review in cubic

…rdItemPrs

The initialData function's cast to 'TaskBoardItemPr[] | undefined' already
includes undefined as a valid type, making the trailing '?? undefined' a no-op.
Remove it to simplify the code and improve readability.
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.

1 participant