jgroth / kompendium

Documentation generator for Stencil components https://kompendium.dev/
MIT License
9 stars 5 forks source link

In the generated docs, show `Optional: true/false` (or similar), when neither `!` nor `?` is specified in a prop #120

Open Kiarokh opened 1 year ago

Kiarokh commented 1 year ago

If we have neither ! nor ? in a prop, the docs show this:

image

adrianschmidt commented 1 year ago

Yeah, Johan and I have talked about this at some point. I was pretty convinced there was an issue already, but apparently not. Thanks for making one!

jgroth commented 1 year ago

I'm not really sure why there are two of these anyway :smile: It should be either optional or required, it can't really be both :smile: Stencil will make everything optional by default, so maybe we should just keep the one named "Required"? I'm guessing it will be true when ! is used.

adrianschmidt commented 1 year ago

Yes. Let's only show Required: true if there's an !. Otherwise, we show Required: false. And let's never show "Optional".