Skip to content

Wrong detection for redundant param statement #79

@Aetet

Description

@Aetet

if I have params with properties and more than one argument I have wrong detection for redundant param statement.

Example of code linting fails on jscs-jsdoc v 0.4.0:

/**
 * Example function
 * @param {Object} options some options
 * @param {Number} options.id some id
 * @param {String} options.filename some filename
 * @param {Array} rest rest arguments
 * @returns {Boolean} to be or not to be
 */
function hello(options, rest) {
    return (options.filename) ? true : false;
}

Fail log:

Message:
    redundant param statement at example.js :
     1 |/**
--------^
     2 | * Example function
     3 | * @param {Object} options some options

If code looks like this it works like a charm:

/**
 * Example function
 * @param {Object} options some options
 * @param {Number} options.id some id
 * @param {String} options.filename some filename
 * @returns {Boolean} to be or not to be
 */
function hello(options) {
    return (options.filename) ? true : false;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions