Skip to content
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

How to document properties with colon? #2094

Open
markcellus opened this issue Nov 4, 2023 · 2 comments
Open

How to document properties with colon? #2094

markcellus opened this issue Nov 4, 2023 · 2 comments

Comments

@markcellus
Copy link

I recently have to work with RSS/XML objects that have colons in the property name e.g. dc:creator. How is this expressed in JSDocs? Whenever I try adding dc:creator to typed object, it's not recognized.

Input code

/**
 * @typedef {object} XMLChannel
 * @property {string} [dc:creator]
 */

Expected behavior

Output and support by JSDoc integrated tools like VSCode

Current behavior

Outputs nothing + causes error in JSDoc supported tools like VSCode

@begin-again
Copy link

/**
 * @typedef {{
 *  'dc:creator': string
 * }} XMLChannel
 */

@markcellus
Copy link
Author

markcellus commented Nov 21, 2023

Yeah but I'd have to make a seperate typedef just for this property or change all of my other types to use this inline {{}} syntax just for this property.

I was hoping that there was a way to declare the property without changing the type syntax everywhere. If anyone knows of a way, please do send it my way! Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants