Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix compiler error "does not satisfy the constraint 'ObjectNested'" #5607

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

colinrotherham
Copy link
Contributor

This PR fixes #5606

Affects ConfigurableComponent<CustomConfig> in v5.8.0 where CustomConfig doesn't extend ObjectNested

   * @virtual
-  * @template {ObjectNested} [ConfigurationType={}]
+  * @template {Partial<Record<keyof ConfigurationType, unknown>>} [ConfigurationType=ObjectNested]
   * @template {Element & { dataset: DOMStringMap }} [RootElementType=HTMLElement]
   * @augments GOVUKFrontendComponent<RootElementType>

I've shared the config type via Schema Schema<ConfigurationType> for use in @param and @returns too

This may not have affected JSDoc due to The Empty Object Type in TypeScript

@domoscargin domoscargin added awaiting triage Needs triaging by team javascript 🐛 bug Something isn't working the way it should (including incorrect wording in documentation) and removed awaiting triage Needs triaging by team labels Jan 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐛 bug Something isn't working the way it should (including incorrect wording in documentation) javascript
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom component configs cause TypeScript compiler errors
2 participants