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

[discussion] property analysis behavior is strange #112

Closed
jrobinson01 opened this issue Oct 23, 2019 · 1 comment
Closed

[discussion] property analysis behavior is strange #112

jrobinson01 opened this issue Oct 23, 2019 · 1 comment

Comments

@jrobinson01
Copy link
Contributor

jrobinson01 commented Oct 23, 2019

Given a plain JS lit-element like so:

/**
* @prop {boolean} myProperty - description for myProperty
*/
class MyElement extends LitElement {
    static get properties() {
        return {
           myProperty: { type: Boolean }
        }
    }
    constructor() {
        super();
        this.myProperty = false;
        this.myBoundFunction = this.someFunction.bind(this); 
    }
    
    someFunction() {
    }
}

The (JSON) output contains both the myProperty and myBoundFunction properties. It seems that wca is analyzing not only the jsdoc but also the component's constructor. This seems to be causing two issues. The first is that the descriptions are not present in the output, and the second is that I wouldn't expect myBoundFunction to be present in the output. I see that there is work to support @private/@protected, which may solve the latter issue.

@daKmoR
Copy link

daKmoR commented Oct 23, 2019

imho every public property or function should be of interest as that is the public api right?

you can prefix a function with _ so the become "protected" and will not appear in the public properties list as far as I know.

you could also use the js "#myPrivateFunction"

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

3 participants