fix(types): add missing types for Player and ReactJSX#3732
fix(types): add missing types for Player and ReactJSX#3732sanoojes wants to merge 4 commits intospicetify:mainfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis PR augments public TypeScript declarations: adds Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~3 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 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.
🧹 Nitpick comments (1)
globals.d.ts (1)
270-281: Consider making the index signature return type account for absent properties.The index signature
[key: string]: stringis a good addition for extensibility. However, it implies that any arbitrary property access will returnstring, when in reality properties may be absent at runtime. Compare with the existingMetadatatype on line 167 which usesPartial<Record<string, string>>.A more precise signature would be:
- [key: string]: string; + [key: string]: string | undefined;This would make TypeScript enforce null checks on dynamic property access while still allowing the explicitly declared fields to be treated as present.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@globals.d.ts` around lines 270 - 281, The index signature currently declared as [key: string]: string incorrectly forces all dynamic property access to be string even when properties may be absent; update the signature in the same interface that contains associated_video_id, video_association, video_association_image, etc. to allow undefined (for example change [key: string]: string to [key: string]: string | undefined or replace with Partial<Record<string, string>> to match the existing Metadata pattern) so consumers must handle missing keys while keeping the explicit fields typed as strings.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@globals.d.ts`:
- Around line 270-281: The index signature currently declared as [key: string]:
string incorrectly forces all dynamic property access to be string even when
properties may be absent; update the signature in the same interface that
contains associated_video_id, video_association, video_association_image, etc.
to allow undefined (for example change [key: string]: string to [key: string]:
string | undefined or replace with Partial<Record<string, string>> to match the
existing Metadata pattern) so consumers must handle missing keys while keeping
the explicit fields typed as strings.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 3954b44e-d8a8-40d8-9f57-acd436afee90
📒 Files selected for processing (1)
globals.d.ts
Summary by CodeRabbit