Expected behavior
No error
Actual behavior
Error
X:X error Missing @template T jsdoc/require-template
If change @template {string | Buffer} [T=string] to @template {string | Buffer} T all works fine.
ESLint Config
{
"jsdoc/require-template": "error",
}
ESLint sample
/**
* @template {string | Buffer} [T=string]
* @typedef {object} Dirent
* @property {() => boolean} isFile true when is file, otherwise false
* @property {() => boolean} isDirectory true when is directory, otherwise false
* @property {() => boolean} isBlockDevice true when is block device, otherwise false
* @property {() => boolean} isCharacterDevice true when is character device, otherwise false
* @property {() => boolean} isSymbolicLink true when is symbolic link, otherwise false
* @property {() => boolean} isFIFO true when is FIFO, otherwise false
* @property {() => boolean} isSocket true when is socket, otherwise false
* @property {T} name name
* @property {string} parentPath path
* @property {string=} path path
*/
Environment
- Node version: v22.13.1
- ESLint version v9.28.0
eslint-plugin-jsdoc version: v51.2.2
Expected behavior
No error
Actual behavior
Error
If change
@template {string | Buffer} [T=string]to@template {string | Buffer} Tall works fine.ESLint Config
ESLint sample
Environment
eslint-plugin-jsdocversion: v51.2.2