Skip to content

Wrapped Function jsdoc/require-jsdoc #1624

@sampyeattrsm

Description

@sampyeattrsm

Motivation

Visual ascetics of the code. I would like the JSdoc to be outside of the wrapper function and still be identified for the wrapped function. I dont know if this is possible since it is a bit of an edge case.

Current behavior

If a function has a wrapper around it, and there is a js doc above the wrapped function, a error is thrown.

// Throws error (would like this to resolve)
    /**
     * JSdoc for foo function
     */
const foo = autolog(function foo() {
        log.debug('inside foo', 'this is a test helper function')
    }
)

// Current Behavior would require this format
const foo = autolog(
    /**
     * JSdoc for foo function
     */
    function foo() {
        log.debug('inside foo', 'this is a test helper function')
    },
)

Desired behavior

Would like to not have a jsdoc error if the jsdoc is outside of the wrapped function

// Throws error (would like this to resolve)
    /**
     * JSdoc for foo function
     */
const foo = autolog(function foo() {
        log.debug('inside foo', 'this is a test helper function')
    }
)

Alternatives considered

I understand this might not be possible or would be too complicated to implement.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions