-
Notifications
You must be signed in to change notification settings - Fork 12.5k
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
Support @const
JSDoc tag
#19672
Comments
@const
JSDoc tag doesn't separate typeExpression
from comment
@const
JSDoc tag
PRs welcomed. |
@mhegazy Maybe you want to add |
I’d like to work on this. |
has any progress been made on this issue? from what I can tell, it looks like #39768 was finished but closed. |
This can be closed Typescript now Supports: since version 4.5+ #39768 implements it export const CBLErrorDomainByCode = /** @type {const} */ ([, "LITE_CORE","POSIX","SQLITE","FLEECE","NETWORK","WEB_SOCKET"]); is type const CBLErrorDomainByCode: readonly [undefined, "LITE_CORE", "POSIX", "SQLITE", "FLEECE", "NETWORK", "WEB_SOCKET"] works like a charm @RyanCavanaugh https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html#unsupported-tags <- needs a update i do not remember where the issues are for this. |
I don't think this is fixed - can we reopen, @RyanCavanaugh? #39768 was closed without being merged, and the example in the previous comment uses the |
Note that the documentation for Typescript points to this issue as being open on this tag. |
TypeScript Version: 2.5.3
Code
Expected behavior:
Type expression and comment should be separate for
@const
(http://usejsdoc.org/tags-constant.html) tags. See below for further explanation.Actual behavior:
Parsing the above JSDoc (with help from tsutils which as far as I can see is just using Typescript parsing tools), I get the following node for the
@const
JSDoc tag.Destructuring the relevant
ts.JSDocTag
object (const { typeExpression, comment } = tag
), I get the following:My expectation would be for the type expression to be separate as outlined in http://usejsdoc.org/tags-constant.html
The text was updated successfully, but these errors were encountered: