Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
Zamiell opened this issue Aug 16, 2022 · 1 comment
Closed
Labels

Comments

@Zamiell
Copy link
Contributor

Zamiell commented Aug 16, 2022

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".

@Zamiell
Copy link
Contributor Author

Zamiell commented Aug 26, 2022

Thanks Brett ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants