-
-
Notifications
You must be signed in to change notification settings - Fork 169
Closed
Description
Expected behavior
No error when casting generic types.
Actual behavior
The type 'T' is undefined. (jsdoc/no-undefined-types)
ESLint Config
module.exports = {
root: true,
parser: "@babel/eslint-parser",
parserOptions: {
requireConfigFile: false,
},
env: {
browser: true,
es2021: true,
},
extends: "eslint:recommended",
plugins: [
"jsdoc",
],
settings: {
jsdoc: {
mode: "typescript",
},
},
rules: {
"jsdoc/no-undefined-types": ["error"],
},
};ESLint sample
/**
* @template T
*/
export class Foo {
// cast to T
getType() {
const x = "hello";
const y = /** @type {T} */ (x);
return y;
}
}Environment
- Node version:
v16.13.0 - ESLint version:
v8.2.0 - eslint-plugin-jsdoc version:
37.4.0