No warning should be triggered when this param is accompanied by a destructured parameter.
Actual behavior
A warning is triggered, implying that the @param for the destructured root is being referenced as a match for this
Note: this warning does not trigger when the parameter following this is not destructured, or when @param is explicitly provided for this, as in the following cases:
/**
* Returns the sum of two numbers
* @param {number} a First value
* @param {number} b Second value
* @returns {number} Sum of a and b
*/
function sum(this: unknown, a: number, b: number) {
return a + b;
}
/**
* Returns the sum of two numbers
* @param this 'this'
* @param options Object to destructure
* @param options.a First value
* @param options.b Second value
* @returns Sum of a and b
*/
function sumDestructure(this: T, { a, b }: { a: number, b: number }) {
return a + b;
}
/**
* Returns the sum of two numbers
* @param options Object to destructure
* @param options.a First value
* @param options.b Second value
* @returns Sum of a and b
*/
function sumDestructure(this: unknown, { a, b }: { a: number, b: number }) {
return a + b;
}
Expected behavior
No warning should be triggered when
this
param is accompanied by a destructured parameter.Actual behavior
A warning is triggered, implying that the
@param
for the destructured root is being referenced as a match forthis
Note: this warning does not trigger when the parameter following
this
is not destructured, or when@param
is explicitly provided forthis
, as in the following cases:ESLint Config
ESLint sample
Environment
eslint-plugin-jsdoc
version: 48.0.2