-
Notifications
You must be signed in to change notification settings - Fork 486
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
Fix github links for @typedef comments #1024
Conversation
I've been having a lot of difficulty with testing. I'm not familiar with jest, and the error messages I'm seeing seem obviously not true. |
'-' + | ||
'L' + | ||
comment.context.loc.end.line, | ||
urlPrefix + fileRelativePath + '#L' + startLine + '-' + 'L' + endLine, |
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 didn't intend to re-format this, fwiw. Looks like a commit hook re-formatted.
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.
Yep, that's the intended way - we use husky
to add a commit hook and then lint-staged
to run run prettier on source files. It's a mouthful but it totally eliminates stylistic eslint rules, the computer decides what's best in terms of formatting. And since this changes comment.context.loc.end.line
to endLine
, the computer decided that it's short enough to fit on one line, so it did :)
👍 Great, thanks Bob! Merging and rolling a release in a bit. |
Unlike other comment blocks,
@typedef
blocks are usually not directly associated with any lines of code.eg, from usejsdoc:
Currently, the github link that's produced for a
@typedef
block points to the nearest AST node, which would be thefunction
in this case. This change uses the comment block's location instead.