-
-
Notifications
You must be signed in to change notification settings - Fork 163
valid-types: Only checks the name of typedef but not the definition #305
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
Upon further investigation, the following tags also skip type checks because they are listed as For example, here type is not checked at all because /**
* @constant {number}
*/
var bar; |
Also, of note, this behaviour leads to Syntax error when validating GCC variant of typedef syntax: /**
* @typedef {String}
*/
let Foo; Rather than parsing |
Another Syntax Error I got on /**
* @template A
*/
class Parent {}
/**
* @extends {Parent<string>}
*/
class Child extends Parent {} Here it fails to properly set up the parser for |
Regarding The other concerns look valid though note that I'd strongly prefer to have a cross-rule setting to set the mode to jsdoc, typescript, or gcc, so we could auto-tweak accordingly, and not be overly lenient if the desired environment doesn't support the type (unless the user opts in, e.g., it would be ok for a rule to add |
Yes, there’s a bit of caveat is that per the same spec JSDoc supports angled bracket notation to specify some templa-ty classes like Array. So, /**
* @extends Array<string>
*/
class StringArray {} |
Yes, that latter example should be valid, but I was not clear, I actually meant curly brackets were not supposed to be as part of |
🎉 This issue has been resolved in version 15.9.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
The following comment has two types: typedef name (
Foo
) and its value (String
):valid-types
only checks typedef name (Foo
) for validity and not the value.I debugged this a bit and figured
valid-types
rule when iterating over tags goes intoisNamepathTag
execution branch while checking of they type value is done inisTagWithType
branch.@typedef
is essentially both and should go through both.The text was updated successfully, but these errors were encountered: