Closed
Description
Expected behavior
I expect the rule match-description
do detect correctly the start of the description.
Actual behavior
The rule match-description
fails to detect the description on a @template
using a complex default value. Note that require-hyphen-before-param-description
fails as well, but I suppose it's linked.
ESLint Config
"jsdoc/require-hyphen-before-param-description": ["warn", "always", {
tags: {
...
template: "always"
}
}],
"jsdoc/match-description": ["warn", {
contexts: ["any"],
matchDescription: "^[A-Z].*[^\\.]$",
tags: {
...
template: {
message: "@template description should begin with a capital letter and not end with a period.",
match: true
}
}
}]
Full config available here.
ESLint sample
/**
* @template {any} T - Arg 1
* @template {string | number} K - Arg 2
* @template {any} [R=(K extends keyof T ? T[K] : never)] - Arg 3 -> Errors here
* @typedef {any} Test
*/
There must be a hyphen before @template description.
@template description should begin with a capital letter and not end with a period.
Autofix of require-hyphen-before-param-description
will add the hyphen after T[K]
.
Environment
- Node version: 20.9.0
- ESLint version: 8.57.0
eslint-plugin-jsdoc
version: 48.10.2