Open
Description
Expected behavior
The jsdoc/require-param
should add exactly one new @param
tag - one for each missing parameter.
Actual behavior
For each missing parameter, it adds all missing parameters. For n missing parameters, it will add n*n @param
tags.
ESLint Config
/** @type {import("eslint").Linter.Config} */
module.exports = {
env: {
browser: true,
es6: true
},
root: true,
parser: "@typescript-eslint/parser",
plugins: [
"@typescript-eslint",
"jsdoc"
],
parserOptions: {
ecmaVersion: 2018,
sourceType: "module",
ecmaFeatures: {
node: true,
spread: true
}
},
rules: {
"jsdoc/require-param": "error"
},
settings: {
jsdoc: {
mode: "typescript"
}
},
}
ESLint sample
/**
* Foo.
*/
function foo(a: number, b: number, c:number):void {
throw new Error();
}
Output:
/**
* Foo.
* @param a
* @param b
* @param c
* @param a
* @param b
* @param c
* @param a
* @param b
* @param c
*/
function foo(a: number, b: number, c:number):void {
throw new Error();
}
Environment
- Node version: v14.15.4
- ESLint version v7.26.0
eslint-plugin-jsdoc
version: 35.4.1
Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.