Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
2 tasks done
KonnorRogers opened this issue May 6, 2024 · 1 comment
Closed
2 tasks done

Comments

@KonnorRogers
Copy link
Contributor

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

@thepassle
Copy link
Member

Fixed in #252

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants