runem / web-component-analyzer

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

Add handleEvent to HTML element method names #184

Open web-padawan opened 3 years ago

web-padawan commented 3 years ago

I'm using the handleEvent approach for event listeners in my Custom Element, and it looks like this:

constructor() {
  super();
  // ...
  this.addEventListener('mousedown', this);
}

handleEvent(event) {
  // do something
}

Currently, this results in handleEvent being included in the methods output from analyzer.

It would be good to consider handleEvent an internal implementation detail:

https://github.com/runem/web-component-analyzer/blob/87028d1f595740fd0beb5150c1b791710a63795a/src/analyze/flavors/custom-element/discover-methods.ts#L47-L49