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

Using the word typeof in a doc comment breaks tsd-jsdoc output #137

Open
mramato opened this issue Jun 5, 2020 · 0 comments
Open

Using the word typeof in a doc comment breaks tsd-jsdoc output #137

mramato opened this issue Jun 5, 2020 · 0 comments

Comments

@mramato
Copy link
Contributor

mramato commented Jun 5, 2020

As discussed in #128 (comment).

#128 breaks code that includes the word typeof in a JSDoc comment without being the intended Closure feature, tsd-jsdoc outputs an error and fails.

Code like this:

/**
 * Breaks if test if typeof 'function' is included.
 *
 * @param {String} name Some param
 * @function
 */
function someFunction(name) {}

Causes this output:

ERROR: Unable to parse a tag's type expression for source file /home/mamato/Git/CesiumGS/cesium/Source/Core/Check.js in line 1 with tag title "param" and text "{String>} name Some param": Invalid type expression "String>": Expected "!", "#", "$", "(", "-", ".", "/", "0", ":", "<", "=", "?", "@", "[]", "\\", "_", "|", "~", "‌", "‍", Unicode combining mark, Unicode decimal number, Unicode letter number, Unicode lowercase letter, Unicode modifier letter, Unicode other letter, Unicode punctuation connector, Unicode titlecase letter, Unicode uppercase letter, [1-9], or end of input but ">" found.
ERROR: Unable to parse a tag's type expression for source file /home/mamato/Git/CesiumGS/cesium/Source/Core/Check.js in line 7 with tag title "param" and text "{String>} name Some param": Invalid type expression "String>": Expected "!", "#", "$", "(", "-", ".", "/", "0", ":", "<", "=", "?", "@", "[]", "\\", "_", "|", "~", "‌", "‍", Unicode combining mark, Unicode decimal number, Unicode letter number, Unicode lowercase letter, Unicode modifier letter, Unicode other letter, Unicode punctuation connector, Unicode titlecase letter, Unicode uppercase letter, [1-9], or end of input but ">" found.

And then the entire process exits with a return code of 1.

The regex or approach to the feature needs to be tweaked to be less agressive.

To work around the issue in the short term, you can simple add a space, i.e. changing * Breaks if test if typeof 'function' is included. to * Breaks if test if type of 'function' is included. avoid the issues.

CC @aidinabedi

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

1 participant