Skip to content

check-param-names enhancement #56

@tunnckoCore

Description

@tunnckoCore

Just look these cases

/**
 * would report:
 * expected message but got `message`
 *
 * @param {String} `message`
 */
function methodOne(message) {}

/**
 * would report:
 * expected required but got <required>
 *
 * @param {String} <required>
 * @param {Object} [optional]
 */
function methodTwo(required, optional) {}

/**
 * would report:
 * expected required but got `<required>`
 * expected optional but got `[optional]`
 *
 * @param {String} `<required>`
 * @param {Object} `[optional]`
 */
function methodThree(required, optional) {}

Need explanation? Reports because of **, <, >** chars in tag.name.value`'s

The solution is to add escaping just before if statement

tag.name.value = tag.name.value.replace(/[\`\<\[\]\>]/g, '');

We use these because we use code comments to generate markdown docs automagically.

Want PR?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions