runem / web-component-analyzer

CLI that analyzes web components and emits documentation
https://runem.github.io/web-component-analyzer
MIT License
507 stars 65 forks source link

Optional string literal alias type not shown in JSON format output #198

Open Niznikr opened 4 years ago

Niznikr commented 4 years ago

When specifying a string literal type with alias to a TS optional LitElement property, web-component-analyzer outputs the full list of possible values, in this case: "type": "\"academic-content\" | \"add\" | \"arrow-down\" | \"arrow-left\" | \"arrow-right\" | \"arrow-up\" | \"attachment\" | \"base\" | \"book\" | \"checkmark-inverse\" | \"checkmark-small\" | \"checkmark\" | ... 51 more ... | undefined".

The property is defined as:

@property({ type: String, reflect: true })
public name?: IconName;

I would instead expect the type to be returned as IconName | undefined in the JSON output unless I explicitly passed --inline-types. That or I would like the full list returned instead of the hint like format which includes the ...51 more.... Any help would be appreciated!