-
-
Notifications
You must be signed in to change notification settings - Fork 160
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
[check-template-names
] @property is ignored
#1269
[check-template-names
] @property is ignored
#1269
Comments
The issue is apparently instead that a generic cannot be indicated in the name like this: Does TypeScript accept this form of JSDoc? I don't see it at https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#template . |
You're right, the error is reported with a single I tested the following file in TS Playground. Without a generic or with an invalid generic, TypeScript returns the same errors (number not assignable to string). The /**
* @template {Object} T
* @typedef Foo<OUPS_I_MAKE_A_TYPO>
* @prop {T} bar
*/
/**
* @type {Foo<string>}
*/
const fooValid = { bar: "" };
/**
* @type {Foo<string>}
*/
const fooInvalid = { bar: 0 };
// ~~~
/**
* @template {Object} T
* @typedef Baz
* @prop {T} qux
*/
/**
* @type {Baz<string>}
*/
const bazValid = { qux: "" };
/**
* @type {Baz<string>}
*/
const bazInvalid = { qux: 0 };
// ~~~ eslint-plugin-jsdoc should report a syntax error for a JSDoc comment with |
Yeah, I think that is a dupe of #374. |
The /**
* @typedef Foo
* @prop {string} bar
*/ And no error with: /**
* @typedef {Object} Foo
* @prop {string} bar
*/ In the examples in the TypeScript documentation, the type is always specified. But |
Ah, great to know the playground can have tsconfig set to JavaScript. Wasn't aware of that. I have confirmed the bug as you report now, yes. For now, I can change to silently ignore such parse errors here as when there is no type present, but I'll leave the issue open to try to handle the case for use of |
…h missing or bad typedef type; partial fix for gajus#1269
…h missing or bad typedef type; partial fix for #1269
check-template-names
] two @template
in one filecheck-template-names
] @property is ignored
🎉 This issue has been resolved in version 48.8.3 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Expected behavior
eslint-plugin-jsdoc should support two
@template
in one file.Actual behavior
ESLint Config
ESLint sample
Environment
eslint-plugin-jsdoc
version: 48.8.1The text was updated successfully, but these errors were encountered: