-
Notifications
You must be signed in to change notification settings - Fork 38
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
Handle Multiple JSDoc Correctly #1080
Comments
Let me know if this is done intentionally. Otherwise the fix is very simple, we can use the last parsed JSDoc instead of throwing errors. |
@Noeyfan This is intentional, jsDoc nodes are associated with the next non-jsDoc node immediately following it. Spot treats jsDoc nodes as part of its syntax and expects at most one jsDoc node associated with any node. To leave general comments in files you can use regular inline comments or block comments. None of the below comments will be parsed by Spot: // inline comment
/* block comment */
/*
multi
line
block
comment
*/ |
I see, the problem I've encountered is when file have a copyright info:
I understand we can probably use block comment for copyright info, but seems it go against the convention, https://jsdoc.app/tags-license.html, and could result in issue for other toolings. So using the immediate JSDoc before the definition instead of fail the generation still seems a correct thing to do. |
Ah I see.
Your suggestion is appropriate 👍. |
Describe the bug
SPOT generate fail when multiple JSDoc occurred before any type definition.
To Reproduce
Below is the
api.ts
fileRunning command:
Will result in error:
Expected behavior
The generation should success and produce the expected result.
Screenshots
N/A
Desktop (please complete the following information):
@airtasker/spot/1.2.0 darwin-x64 node-v12.13.0
Additional context
The text was updated successfully, but these errors were encountered: