runem / web-component-analyzer

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

bugfix: check custom element definitions for correct object #83

Closed 43081j closed 5 years ago

43081j commented 5 years ago

hello

this is to reduce the greediness of your define visitor as it currently picks up a lot of false positives in codebases where other classes have a define method.

i added a check to ensure it the left hand expression is customElements or window.customElements.

i haven't yet figured out your test workflow but will add a test case once i have

ah and a few of your tests had customElement.define which seemed wrong.. LMK if it was on purpose.

43081j commented 5 years ago

FYI tests pass now that i fixed the customElements typo that was already there

p.s. do get CI setup so we can see some builds please if you get the chance :p

runem commented 5 years ago

Hi James, this looks great! Thank you so much for your contribution :-)

I'll release a new version of wca within a couple of days.

i haven't yet figured out your test workflow but will add a test case once i have

I'll add a test for this and then I'll make sure to describe the test workflow in a contribution guide, sorry!

FYI tests pass now that i fixed the customElements typo that was already there

That was definitely a typo! The 's'-key on my keyboard is very broken atm :/

p.s. do get CI setup so we can see some builds please if you get the chance :p

I have CI set up, but it might have been configured incorrectly since it's not running for PRs. I'll look into it!