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

Rule check-param-names does not recognize optional parameters. #33

Closed
bennieswart opened this issue Apr 28, 2017 · 0 comments
Closed

Rule check-param-names does not recognize optional parameters. #33

bennieswart opened this issue Apr 28, 2017 · 0 comments

Comments

@bennieswart
Copy link
Contributor

bennieswart commented Apr 28, 2017

Consider the following code:

/**
 * When the Edit Invoice button is clicked.
 * @param {invoice} invoice - The selected Invoice.
 * @param {string} [subscreen]- Subscreen the BillingScreen should load on when opened.
 */
AccountScreen.prototype.onViewEditInvoiceClick = function (invoice, subscreen) {
    // ...
};

The rule check-param-names gives this error:
error Expected @param names to be "invoice, subscreen". Got "invoice, [subscreen=false]-" jsdoc/check-param-names

To my understanding this should not be an error. The same goes for [subscreen=somedefault], which also reports an error.

Is my understanding correct? Will someone fix this? I'm willing, but will have to get familiarized with the code first.

Edit: None of which I have said is true. There was a missing space between the [subscreen] and the dash, which caused all the trouble. It seems that optional parameters are indeed handled correctly.

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

1 participant