Skip to content

[require-jsdoc] False positive for exported overload functions #645

@neurolag

Description

@neurolag

Expected behavior

TSDeclareFunctions should report no error even if they have a prepended export.

Actual behavior

An error is reported sayin that the jsdoc-comment is missing.

ESLint Config

{
    rules: {
        "jsdoc/require-jsdoc": [
            "warn",
            {
                require: {
                    FunctionDeclaration: true
                },
                contexts: [
                    "TSDeclareFunction"
                ]
            }
        ]
    }
}

ESLint sample

/**
 * This is a text.
 */
function x(); // works great

/**
 * This is a text.
 */
function x(text: string) { }

/**
 * This is a text.
 */
export function a(); // Reports an error

/**
 * This is a text.
 */
export function a(text: string)
{ }

Environment

  • Node version: v12.18.3
  • ESLint version v7.10.0
  • eslint-plugin-jsdoc version: 30.6.2

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions