-
Notifications
You must be signed in to change notification settings - Fork 32
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
Validate annotation tag names #18
Comments
There are two solutions from my pov:
I think better to have presets. But if you've make some basic realization e.g. jsduck set I'll do the rest. So PR is welcome. Thanks for ideas! upd: Btw, we can parse JSDuck set from their wiki. And I think there're same possible solutions for JSDoc3 and Google Closure tag sets. Tag is what you calling "Annotation Name". Anywhere in code you'll see "tag". |
I've created a PR with a first draft for presets for JSDuck 5, JSDoc 3 and the Closure Compiler. As far as validation is concerned, that's about as far as I would want to go. Although I'm not sure where we should define which tags expect a type expression that needs to be validated. For instance, the syntax for Also, it's probably a good idea to extend the configuration like so: "jsDoc": {
"checkAnnotations": "jsduck" // whitelists JSDuck tags
// equivalent to
"checkAnnotations": {
"preset": "jsduck"
}
// which can be extended to
"checkAnnotations": {
"preset": "jsduck",
"extra": {
"mycustomtag": false
}
}
} because we need to take into account that tools like JSDuck allows the definition of custom tags. |
Wow, nice work. Atm all tags parsing with rule Another idea is to use patterns for tags. For example: {
"type": "<type> <description>",
"var": "<type> <description>",
"param": "<type> <name> <description>",
"returns": "<type> <description>"
} What you think? |
@pigulla I've made some basic functionality for this. Can you take a look at PR? |
It would be nice if the plugin could also validate annotation names, e.g.:
would fail because no such tag exists (typo).
Ideally, there would be various ways to configure this:
Might be a good idea to add version support from the get-go, so use
jsdoc3
,jsduck4
,jsduck5
etc.The text was updated successfully, but these errors were encountered: