github-url-detection
github-url-detection copied to clipboard
POC for JSDoc extraction
For https://github.com/refined-github/github-url-detection/issues/146
I found a package that allows extraction of URLs from JSDoc. The issue is that we sometimes have comments around test URLs, which are impractical in JSDoc:
- while they can be easily filtered out, any deviations from the expected comment position would require future changes to this setup
but mainly:
- JSDoc are user-facing, but these comments might not make sense outside the source code, e.g.
/**
* Some of these are here simply as "gotchas" to other detections
* @example https://github.com/sindresorhus/refined-github/blame/master/package.json // Gotcha for isRepoTaxonomyIssueOrPRList
* @example https://github.com/sindresorhus/notifications/
*/
this would show up as the description of the isRepo function, which is not relevant to the final user.
The tool also appears to easily allow editing of the files, so I wouldn't exclude going the other way around:
- leave index.ts as is but add the JSDoc after the transpilation, directly to
dist/index.d.ts
Really looking forward it. I've researched some typescript AST parsers for this feature and this is really nice.