Skip to content

refactor: prefer-nullish-coalescing#901

Merged
Yeom-JinHo merged 3 commits intomagicuidesign:mainfrom
Yeom-JinHo:refactor/prefer-nullish-coalescing
Mar 2, 2026
Merged

refactor: prefer-nullish-coalescing#901
Yeom-JinHo merged 3 commits intomagicuidesign:mainfrom
Yeom-JinHo:refactor/prefer-nullish-coalescing

Conversation

@Yeom-JinHo
Copy link
Collaborator

Description

This PR refactors fallback logic in the www app to improve nullish handling and align with @typescript-eslint/prefer-nullish-coalescing.

Changes

  • Replaced safe || fallback patterns with ?? in key runtime files:
    • app/(blog)/blog/[...slug]/page.tsx
    • app/og/route.tsx
    • lib/rehype-component.ts
    • registry/magicui/blur-fade.tsx
    • registry/magicui/client-tweet-card.tsx
    • registry/magicui/icon-cloud.tsx
    • registry/magicui/tweet-card.tsx
    • registry/magicui/typing-animation.tsx
  • Updated registry code generation:
    • scripts/build-registry.mts now emits nullish-coalescing fallbacks.
  • Regenerated derived outputs to keep everything in sync:
    • registry/__index__.tsx
    • public/r/*.json (affected component entries)
    • public/llms-full.txt
  • Minor readability cleanup:
    • Introduced hasContent in app/og/route.tsx to avoid repeated boolean expressions.

Motivation

  • Enforce safer fallback semantics (null/undefined only).
  • Align with linting direction for prefer-nullish-coalescing.
  • Keep source files and generated registry/public artifacts consistent.

Breaking Changes

  • No API-level breaking changes.
  • Behavior note: places migrated from || to ?? now preserve valid falsy values ("", 0, false) instead of falling back.

@vercel
Copy link

vercel bot commented Mar 1, 2026

@Yeom-JinHo is attempting to deploy a commit to the product-studio Team on Vercel.

A member of the Team first needs to authorize it.

@Yeom-JinHo Yeom-JinHo linked an issue Mar 1, 2026 that may be closed by this pull request
@Yeom-JinHo Yeom-JinHo self-assigned this Mar 1, 2026
@Yeom-JinHo Yeom-JinHo force-pushed the refactor/prefer-nullish-coalescing branch from 3f610b7 to 1bd9777 Compare March 2, 2026 08:28
@Yeom-JinHo Yeom-JinHo merged commit a1ed938 into magicuidesign:main Mar 2, 2026
3 of 4 checks passed
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.

Using "||" causes lint errors for nullish checks

1 participant