-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Replace doctrine with comment-parser. #22061
Conversation
@@ -296,7 +296,7 @@ _Returns_ | |||
<a name="getFontSize" href="#getFontSize">#</a> **getFontSize** | |||
|
|||
Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values. | |||
If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. | |||
If namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned. |
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 ignored the tab.
Nice follow-up @sainthkh, thanks for this. My understanding is that our goal is twofold:
As I ramp up to test and understand the solution we need, would you share a few cases of the second point so we have a clear measure of success for this? cc @aduth @sirreal as per their TypeScript-foo. |
Follow-up: the only obvious thing I've noticed we need fixing is the use of
What would be a good way to present this kind of type in the docs? I can think of these alternatives:
I think I'd go with 2. Paired with adding support for extracting the Are there more options available to us? |
I'd agree with this, but heavily preferring if we can move in the direction that the custom types definition can be extracted / included in the documentation (#15186). |
8765c0f
to
fa3146c
Compare
1. About TypeScript types.I intentionally made But To check it yourself, use the code below: const parse = require( 'comment-parser' );
const code = `
/**
*
* @param {{[P in keyof T]?: T[P]}} test It works. (The internal definition for Partial<T>)
* @param {++++} val It even passes.
*
*/
`;
console.log( parse( code )[ 0 ].tags ); And to show those types correctly, we need to decide things in #22062. We can check the validity of types and show them with 2. About Showing Only the Leaf Types.Fortunately, 3. About
|
Closing because it's fixed #28615 |
Description
doctrine
withcomment-parser
.doctrine
behavior and tried not to break generated docs.How has this been tested?
Unit tests.
Screenshots
N/A
Types of changes
Bug fix
Things to discuss.
This PR made me think what's the better way to generate types. The discussion points are in #22062.
Checklist: