Skip to content

Conversation

zacnoo
Copy link

@zacnoo zacnoo commented Jul 9, 2025

Just a starting point to bring a bit more level of detail to the JSDoc representation of arrays of objects.

Currently it just returns a generic array[]

This works for the exact case I'm using it for, but it would needs heaps of work since I've just kinda shoe-horned it in there for my use case, but would love pointers to complete it properly and make it viable to merge.

I'm not sure how universal this style of inline optional props is. Seems to work fine in SublimeText and TSC. What tooling do you usually test against?

@n3ps
Copy link
Owner

n3ps commented Jul 18, 2025

Thanks for this draft. I think you're on the right track if you're just looking to support a simple top-level inline object. Some suggestions:

  • Extract the inline object generation to a function, so the output can simply be pushed into result
  • Simplify the criteria to something like if (prop.type === 'array' && prop.items.type === 'object' ...)

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.

2 participants