fix: avoid TS2698 in generated Drawer.vue for Nuxt 4#1787
fix: avoid TS2698 in generated Drawer.vue for Nuxt 4#1787galoi wants to merge 1 commit intounovue:devfrom
Conversation
📝 WalkthroughWalkthroughMultiple Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Possibly related issues
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 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. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
apps/v4/public/r/styles/reka-mira/drawer.json (1)
1-62:⚠️ Potential issue | 🔴 CriticalAdd the
ComputedRef<Record<string, unknown>>cast to two missing registry JSONs.The fix is incomplete. All Drawer.vue source files are properly covered, but two registry payloads are missing the cast:
apps/v4/public/r/styles/default/drawer.jsonapps/v4/public/r/styles/new-york/drawer.jsonThese must also include the cast in their embedded Drawer.vue content to prevent TS2698 for CLI consumers using those style variants.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@apps/v4/public/r/styles/reka-mira/drawer.json` around lines 1 - 62, In the two missing registry JSONs, update the embedded Drawer.vue so the forwarded variable is explicitly cast to ComputedRef<Record<string, unknown>> to avoid TS2698: change the result of useForwardPropsEmits(props, emits) assigned to forwarded to include the TypeScript cast (keep the existing props/emits, useForwardPropsEmits symbol, and the forwarded identifier); ensure the assignment mirrors the working file where forwarded is defined as const forwarded = useForwardPropsEmits(props, emits) as ComputedRef<Record<string, unknown>> in Drawer.vue.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@apps/v4/public/r/styles/reka-mira/drawer.json`:
- Around line 1-62: In the two missing registry JSONs, update the embedded
Drawer.vue so the forwarded variable is explicitly cast to
ComputedRef<Record<string, unknown>> to avoid TS2698: change the result of
useForwardPropsEmits(props, emits) assigned to forwarded to include the
TypeScript cast (keep the existing props/emits, useForwardPropsEmits symbol, and
the forwarded identifier); ensure the assignment mirrors the working file where
forwarded is defined as const forwarded = useForwardPropsEmits(props, emits) as
ComputedRef<Record<string, unknown>> in Drawer.vue.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 1f47a884-dff7-45f5-acec-f0c64b03e501
📒 Files selected for processing (15)
apps/v4/public/r/styles/new-york-v4/drawer.jsonapps/v4/public/r/styles/reka-luma/drawer.jsonapps/v4/public/r/styles/reka-lyra/drawer.jsonapps/v4/public/r/styles/reka-maia/drawer.jsonapps/v4/public/r/styles/reka-mira/drawer.jsonapps/v4/public/r/styles/reka-nova/drawer.jsonapps/v4/public/r/styles/reka-vega/drawer.jsonapps/v4/registry/bases/reka/ui/drawer/Drawer.vueapps/v4/registry/new-york-v4/ui/drawer/Drawer.vueapps/v4/styles/reka-luma/ui/drawer/Drawer.vueapps/v4/styles/reka-lyra/ui/drawer/Drawer.vueapps/v4/styles/reka-maia/ui/drawer/Drawer.vueapps/v4/styles/reka-mira/ui/drawer/Drawer.vueapps/v4/styles/reka-nova/ui/drawer/Drawer.vueapps/v4/styles/reka-vega/ui/drawer/Drawer.vue
🔗 Linked issue
❓ Type of change
📚 Description
ComputedRef<Record<string, unknown>>cast onuseForwardPropsEmits(props, emits)in the generatedDrawer.vuetemplate.v-bind="forwarded"typed as an object in Nuxt 4 consumers and avoids the reportedTS2698error.📸 Screenshots (if appropriate)
確認項目
pnpm testpnpm lintその他
pnpm --filter v4 typecheckstill fails on unrelated existing errors in files such ascomponents/content/Tabs*.vue,registry/bases/reka/examples/pagination/*.vue, and*/ui/sonner/Sonner.vue.📝 Checklist
Summary by CodeRabbit