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

Shape doesn't properly document optional parameters #62

Closed
pixelzoom opened this issue Aug 23, 2016 · 2 comments
Closed

Shape doesn't properly document optional parameters #62

pixelzoom opened this issue Aug 23, 2016 · 2 comments

Comments

@pixelzoom
Copy link
Contributor

pixelzoom commented Aug 23, 2016

Shape doesn't properly document which parameters are optional. For example, for arc:

    /**
     * @public
     * @param {number} centerX - horizontal coordinate of the center of the arc
     * @param {number} centerY - Center of the arc
     * @param {number} radius - How far from the center the arc will be
     * @param {number} startAngle - Angle (radians) of the start of the arc
     * @param {number} endAngle - Angle (radians) of the end of the arc
     * @param {boolean} anticlockwise - Decides which direction the arc takes around the center
     * @returns {Shape}
     **/
    arc: function( centerX, centerY, radius, startAngle, endAngle, anticlockwise ) {

The anticlockwise parameter is optional, and should have square brackets around the parameter name, to indicate that it's optional:

     * @param {boolean} [anticlockwise] - Decides which direction the arc takes around the center

IntelliJ IDEA has gotten smarter, and is now flagging this as a problem. E.g. for a call to Shape.arc in WavelengthSlider, it's complaining that the anticlockwise arg is missing:

screenshot_88

@pixelzoom
Copy link
Contributor Author

I handled this for [anticlockwise], but I'm unsure if there are other such parameters in Shape. Assigning to @jonathanolson to review and correct any additional documentation errors.

@jonathanolson
Copy link
Contributor

Looks good! Scanned for similar issues and didn't see anything. Closing.

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

No branches or pull requests

2 participants