-
Notifications
You must be signed in to change notification settings - Fork 235
JSDoc fixes - Modify defaults, param name optional and new type support #419
Conversation
70458b8
to
a2a8310
Compare
8f1ce6f
to
219150f
Compare
Can you also add some comments for people not familiar with the JSDoc syntax? For example, adding a comment after the (It'll also help me to review a lot easier :)) |
({(?: | ||
\\* | | ||
\\? | | ||
(?:\\?|\\!|\\.{3})? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the ! needs to be escaped.
@50Wliu Hey! Sure will do. Can you give me a heads up on how to comment within an extended match? What's the syntax? I can't seem to find an example. |
Also, install this. EDIT: 👇 Yeah, that. |
Just |
@Alhadis @50Wliu Cheers guys 👍 |
b7d5576
to
d7733d2
Compare
@50Wliu Something like that ok? |
Yeah - that helps so much! |
Few fixes in this PR 🎉
Fix 1 - Modify defaults
This PR switches what JSDoc defaults to when deciding how many captures to check for. Currently it defaults to 4 with one requiring an
@return
or@returns
tag to only check for 3.Having read the docs further, it's become obvious that 3 should be the default for all tags except for when we have a
@param
or@type
which then requires 4.Fix 2 - Make param name optional
I've also made the param name optional and this change fixes an issue with tags that only have a type specified.
Before:
After:
Fix 3 - Add support for types with a set of type arguments
Adds support a type with a set of type arguments. I.e.
Array<string>
an array of strings.Before:
After:
Fix 4 - Add support for unknown type
Adds support for the unknown type
{?}
Before:
After:
Fix 5 - Add support for key-value pair types
Adds support for specifying the types of key-value pairs within the parameter.
Before:
After:
Lastly
🎨 Added whitespace to break up extremely long JSDoc rules and increase readability. (Please let me know if there's a specific style I should follow!)