Replace doctrine with comment-parser.#22061
Conversation
|
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
doctrinewithcomment-parser.doctrinebehavior 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: