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

Function is missing documentation for parameter undefined with default parameters #194

Open
jipodine opened this issue Mar 7, 2016 · 1 comment

Comments

@jipodine
Copy link

jipodine commented Mar 7, 2016

Hi,

When using an empty object as a default parameter, in a function, a method, or a constructor, I get the following errors, with jscs@2.11.0 and jscs-jsdoc@1.3.1:

jsDoc: Function is missing documentation for parameter `undefined`. at [...]
    30 | * @returns {AudioBuffer}
    31 | */
    32 |export function createDiracBuffer(options = {}) {
jsDoc: Function is missing documentation for parameter `undefined`. at [...]
   140 |   * @returns {Array.<String>} URLs that match every filter.
   141 |   */
   142 |  getUrls(options = {}) {
jsDoc: Function is missing documentation for parameter `undefined`. at [...]
    58 |
    59 |   */
    60 |  constructor(options = {}) {

With the configuration

  "jsDoc": {
    "checkAnnotations": true,
    "checkParamExistence": true,
    "checkParamNames": true,
    "checkRedundantParams": true,
    "checkRedundantReturns": true,
    "checkReturnTypes": true,
    "checkTypes": true,
    "enforceExistence": {
      "allExcept": [
        "arrow",
        "expressions"
      ]
    },
    "requireParamTypes": true,
    "requireReturnTypes": true
  }

And yes, option is defined:

/**
 * Create a Dirac buffer, zero-padded.
 *
 * Warning: the default length is 2 samples,
 * to by-pass a bug in Safari ≤ 9.
 *
 * @param {Object} options
 * @param {AudioContext} options.audioContext must be defined
 * @param {Number} [options.channelCount=1]
 * @param {Number} [options.gain=0] in dB
 * @param {Number} [options.length=2] in samples
 * @returns {AudioBuffer}
 */
export function createDiracBuffer(options = {}) {

Am I missing a configuration somewhere?

@qfox
Copy link
Member

qfox commented Jul 11, 2016

Looks like there is an error with wrong calculating line in checkAnnotations. This rule requires description for EVERY param in your jsdoc. You have 2 lines with missing description: @param {Object} options and @param {Number} [options.channelCount=1]. Also I'm not sure about @returns, prob it requires description too.

You can safely disable this rule to prevent errors of this kind.

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