-
-
Notifications
You must be signed in to change notification settings - Fork 163
no-undefined-types does not consider @template definitions with type constraints #428
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Fixed by 5f48821 |
And released with https://github.com/gajus/eslint-plugin-jsdoc/releases/tag/v17.1.2 . |
😱 Now that's what I call response time. 👍 |
There is still a false positive when the type parameter is used inside the function: /**
* @template T
* @param {T} arg
* @returns {[T]}
*/
function example(arg) {
const result = /** @type {[T]} */ (new Array());
result[0] = arg;
return result;
}
|
@snowteamer : Thank you. Could you please file a new issue? Also if know of docs showing the scope of where the template name can be used? |
I hit the same issue today! |
See also #559 for the template type scope issue. |
When running in typescript mode (
settings.jsdoc.mode = "typescript"
), template types with type constraints are ignored by theno-undefined-types
rule:In the example above, the type constraint on
T
results injsdoc/no-undefined-types
emitting a warning "The type 'T' is undefined". See the Typescript handbook for more examples on typed templates.The text was updated successfully, but these errors were encountered: