open-wc/custom-elements-manifest

properties initialized in the constructor don't get their JSDOC tags read

KonnorRogers opened this issue · 1 comments

Checklist

  • Did you run the analyzer with the --dev flag to get more information?
  • Did you create a minimal reproduction in the playground?

Completing the items above will greatly improve triaging time of your issue.

Expected behavior

I expect using /** @attr */ on a property in the constructor to get added to the custom-elements.json

import { LitElement } from 'lit-element';

export class MyElement extends LitElement {
  /**
   * This gets added as an attribute
   * @attr {number}
   */
  myBar = 0

  constructor () {
    super()
    /**
     * This doesn't get added as an attribute
     * @attr {number}
     */
    this.myFoo = 0
  }
}

Reproduction:

https://custom-elements-manifest.netlify.app/?source=CmltcG9ydCB7IExpdEVsZW1lbnQgfSBmcm9tICdsaXQtZWxlbWVudCc7CgpleHBvcnQgY2xhc3MgTXlFbGVtZW50IGV4dGVuZHMgTGl0RWxlbWVudCB7CiAgICAvKioKICAgICAqIFRoaXMgZ2V0cyBhZGRlZCBhcyBhbiBhdHRyaWJ1dGUKICAgICAqIEBhdHRyIHtudW1iZXJ9CiAgICAgKi8KICBteUJhciA9IDAKICBjb25zdHJ1Y3RvciAoKSB7CiAgICAgIHN1cGVyKCkKICAgIC8qKgogICAgICogVGhpcyBkb2Vzbid0IGdldCBhZGRlZCBhcyBhbiBhdHRyaWJ1dGUKICAgICAqIEBhdHRyIHtudW1iZXJ9CiAgICAgKi8KICAgIHRoaXMubXlGb28gPSAwCiAgfQp9Cg%3D%3D&library=litelement

Fixed in #252