Comments (4)
There are two solutions from my pov:
- make some kind of dictionaries with these sets (and their formats)
- make a set of flexible rules to configure and make presets with right values for them
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".
from jscs-jsdoc.
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 @this
is "@this" <type-expression>
whereas it is "@param" <type-expression> <description>
for the @param
tag.
Maybe the most straight forward solution is to simply assume that everything that directly follows a tag and that looks like a type expression (i.e., is in curly braces) actually is meant to be one.
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.
from jscs-jsdoc.
Wow, nice work. Atm all tags parsing with rule @tag( {type})?( name)?( description)?
I thinking about strict typing (more than true/false) for values in presets. As I can see there are boolean tags (flags) like @abstract
, @chainable
, etc. There are also valuable tags like @link
, @see
, @uses?
. Typed tags like @type
, @return[s]
, @param
. And others. I propose to use true
value for default behaviour (just tag filtering/checking), "boolean"
for no data after tags, "typed"
for @type
. Probably we can also use regexes for custom tags.
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?
from jscs-jsdoc.
@pigulla I've made some basic functionality for this. Can you take a look at PR?
from jscs-jsdoc.
Related Issues (20)
- Separate checkTypes rule into checkTypes and checkNativeTypeCase HOT 1
- Add "trailingUnderscoreAccess" option
- requireDescriptionCompleteSentence is not allowed to be false or null HOT 1
- Support disabling rules in jsdoc HOT 10
- Parameter validation wrongly associates closure and doc block HOT 4
- requireDescriptionCompleteSentence: fails to recognize inlined links. HOT 2
- jsdoc incorrectly validates shorthand arrow functions with nested function signatures
- Merge checkParamNames and checkRedundantParams
- AssertionError with missing braces and multi-line description in @returns tag HOT 1
- Why can't support array[].property jsdoc syntax??
- Tags should be case insensitive HOT 2
- enforceExistence rule not work properly for anonymous function. HOT 3
- False positive "Unexpected data in tag constructor" for JSDuck HOT 1
- @listens tag is missing from jsdoc3.json
- Is there a way to switch off jsdoc enforceExistence for anonymous arrow functions? HOT 3
- Function is missing documentation for parameter `undefined` with default parameters HOT 1
- New Rule: enforce order of tags HOT 2
- Question : How to add custom code to check to jscs-jsdoc module? HOT 4
- an error with jsDoc HOT 1
- [Meta] Is this merging into ESLint? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jscs-jsdoc.