Skip to content

check-param-names - False positives with TypeScript "this" parameter #904

Closed
@Zamiell

Description

@Zamiell

Now that #897 is fixed (thanks for that!), I'm happily using the check-param-names rule in my codebase.
However, the rule gives false positives for the following code pattern:

/**
 * @param arg1 This is the description for arg1.
 */
function foo(this: void, arg1: number): void;

Here, the rule complains that "this" parameter is missing in the JSDoc. But that doesn't make any sense, as this isn't a real function parameter. This is explained in the TypeScript documentation for "declaring this in a function".

Thus, I propose that this rule should be configured to ignore any arguments with a name of "this".

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions