-
-
Notifications
You must be signed in to change notification settings - Fork 159
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
Have namepath checks in valid-types
only allow strict namepaths
#374
Comments
Also, we should lint that certain kinds of child members have valid relationships to the parent in the namepath; for example (I'm not 100% sure about these because the JSDoc spec is poor):
I spent a lot of time in
If you do want to use it, let me know and I will publish a package for it. It's my preference to share a proper dependency than have you cut and paste the code in with the MIT license mandated credit in a comment or something. |
I think it should be possible that an event is defined as an inner object yet such an event instance is fired by a public method on that class and thus needs to document it is arising from a private. class EventName {}
class FooClass {
triggerEventName () {
return new EventName();
}
}
// ...
class PublicAPI {
/**
* @event FooClass~EventName
*/
publicMethod () {
return new FooClass().triggerEventName();
}
}
Feel free to file a separate issue for this. We couldn't really determine if the
I guess the idea here is that a public item would not just be abstract, and so a Such a change sounds reasonable though and would fit well with the change I think will be needed for this issue–to supply However, I think it should probably be added as a default-on option since the docs are not adamant that instance members cannot be used.
Thank you for the offer, but I really think this should be handled in jsdoctypeparser. The grammar makes it easy to understand and maintain (and ensure parsing improvements benefit other parsing uses within our project(s))--might even be useful for your project. Btw, if anyone wants to help with a real bottleneck on jsdoctypeparser that is stalling some things on this project, we haven't been able to get semantic-release working, so any suggestions or help would be appreciated: jsdoctypeparser/jsdoctypeparser#122 . With such a fix in place, we'd be in a better position to make releases there which can be more quickly surfaced in I do have to mention that my health/energy has not been great though, so I'm having to slow down and am not necessarily going to be able to be reliable. |
As raised in #308, contexts where we are checking namepaths in
valid-types
also mistakenly allow for more broad types, e.g.,Array<string>
should get reported in@typedef {StringArray} Array<string>
but it currently is not.I've filed jsdoctypeparser/jsdoctypeparser#86 to possibly have jsdoctypeparser facilitate strict namepath checking rather than examining the parse results more closely here.See also jsdoc-type-pratt-parser/jsdoc-type-pratt-parser#77 and jsdoc-type-pratt-parser/jsdoc-type-pratt-parser#104
Ideally,
@memberof
variation pointers would be valid as well (see #521 ).Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: