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

Unexpected token with type. #145

Open
trusktr opened this issue Jan 22, 2015 · 2 comments
Open

Unexpected token with type. #145

trusktr opened this issue Jan 22, 2015 · 2 comments

Comments

@trusktr
Copy link
Contributor

trusktr commented Jan 22, 2015

I'm having this issue: jsdoctypeparser/jsdoctypeparser#6

I wanted to use famous/core/Context as a return type, but jsdoctypeparser complains. Would be nice to be able to do this to indicate the precise class that's being returned, and plus to help people recognize the classes in the same way they do when they require/import them in their code. f.e.

var Surface = require('famous/core/Surface');

would correspond with

/*
 * @type {famous/core/Surface}
 */

blah/Context could be different than foo/Context in a given library. Any ideas?

@trusktr
Copy link
Contributor Author

trusktr commented Jan 22, 2015

I'll just use famous.core.Surface for now.

@Twipped
Copy link
Collaborator

Twipped commented Mar 18, 2015

So, after digging into this a bit, I have mixed feelings about the solution.

Technically JSDoc types do not support slashes, so jsdoctypeparser is valid to reject it. I have managed to figure out how to get jsdoctypeparser to properly throw the error (instead of sending it to the console), so I can technically trap it and just return the raw input value instead of a proper parse.

I'm just not sure if I should. It would basically be dox absorbing the syntax error in the jsdoc. It could be very confusing to someone under certain circumstances.

I could go either way, so I'm inclined to leave this open to discussion.

@Twipped Twipped added discussion and removed bug labels May 27, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants