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

Support for ES6 assignment pattern #75

Closed
ekhaled opened this issue Aug 27, 2021 · 0 comments · Fixed by #76
Closed

Support for ES6 assignment pattern #75

ekhaled opened this issue Aug 27, 2021 · 0 comments · Fixed by #76
Labels
enhancement New feature or request
Milestone

Comments

@ekhaled
Copy link
Contributor

ekhaled commented Aug 27, 2021

This works awesome:

<script>
    /**
     * The method comment.
     * @param {string} param1 - the first parameter
     * @param {boolean} [param2=false] - the second parameter
     * @returns {number} - return value description
     */
    export function publicMethod(param1, param2) {
        return 0;
    };
</script>

But having this auto-documentation will be even more awesome:

<script>
    /**
     * The method comment.
     * @param param2 - description of the second param
     * @returns {number} - return value description
     */
    export function publicMethod(param1 = "a", param2 = 1) {
        return 0;
    };
</script>

Here we can infer the parameter type as well as the default value because of the ES6 assignment pattern.
And all we have to do is supply a description in the comments

@alexprey alexprey added the enhancement New feature or request label Aug 30, 2021
@alexprey alexprey added this to the 4.0.0 milestone Aug 30, 2021
alexprey added a commit that referenced this issue Aug 30, 2021
fix #75: support for ES6 assignment pattern in methods
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants