runem / web-component-analyzer

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

Analyzing properties doesn't work when assigned to a variable #172

Closed t4y3 closed 4 years ago

t4y3 commented 4 years ago

Is there a workaround? Or is it better not to assign it to a variable?

[demo](https://runem.github.io/web-component-analyzer/?format=json&code=import%20%7B%20LitElement%2C%20html%20%7D%20from%20%27lit-element%27%3B%0A%0Aconst%20Foo%20%3D%20class%20SimpleGreeting%20extends%20LitElement%20%7B%0A%0A%20%20static%20get%20properties()%20%7B%0A%20%20%20%20return%20%7B%20name%3A%20%7B%20type%3A%20String%20%7D%20%7D%3B%0A%20%20%7D%0A%0A%20%20constructor()%20%7B%0A%20%20%20%20super()%3B%0A%20%20%20%20this.name%20%3D%20%27World%27%3B%0A%20%20%7D%0A%20%20%0A%20%20render()%20%7B%0A%20%20%20%20return%20html%60%3Cp%3EHello%2C%20%24%7Bthis.name%7D!%3C%2Fp%3E%60%3B%0A%20%20%7D%0A%7D%0A%0AcustomElements.define(%27simple-greeting%27%2C%20Foo)%3B%0A)

runem commented 4 years ago

Thanks for reporting this bug and thanks for the repro! The next version of WCA will support this pattern. You can test it yourself by running npx web-component-analyzer@next src.