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

Surface JSDoc errors to the user better #1

Closed
toddself opened this issue Dec 12, 2013 · 2 comments
Closed

Surface JSDoc errors to the user better #1

toddself opened this issue Dec 12, 2013 · 2 comments

Comments

@toddself
Copy link

JSDoc fails on malformed JS files. Sometimes malformed JS files are OK (i.e. JSX for React).

The error is confusing:

13:13:34 ~/src/.../conde/jsxhint:master ✔
↳ wicked
file /usr/local/share/npm/lib/node_modules/wicked/node_modules/jsdoc/package.json
jsdoc /usr/local/share/npm/lib/node_modules/wicked/node_modules/jsdoc/jsdoc.js
info wicked Cloning wiki from git@github.com:CondeNast/JSXHint.wiki.git
ERR! wicked Error: prog /Users/tkenned2/src/conde/jsxhint --destination /var/folders/lq/_krxd6ln1dd2_nghgp82tw08fx_b3n/T/CondeNast-JSXHint/out --configure /usr/local/share/npm/lib/node_modules/wicked/config/jsdocrc.json returned with code 8
ERR! wicked     at ChildProcess.<anonymous> (/usr/local/share/npm/lib/node_modules/wicked/lib/run.js:46:15)
ERR! wicked     at ChildProcess.EventEmitter.emit (events.js:98:17)
ERR! wicked     at maybeClose (child_process.js:735:16)
ERR! wicked     at Process.ChildProcess._handle.onexit (child_process.js:802:5)
ERR! wicked  { [Error: prog /Users/tkenned2/src/conde/jsxhint --destination /var/folders/lq/_krxd6ln1dd2_nghgp82tw08fx_b3n/T/CondeNast-JSXHint/out --configure /usr/local/share/npm/lib/node_modules/wicked/config/jsdocrc.json returned with code 8
ERR! wicked Details:
ERR! wicked Error: prog /Users/tkenned2/src/conde/jsxhint --destination /var/folders/lq/_krxd6ln1dd2_nghgp82tw08fx_b3n/T/CondeNast-JSXHint/out --configure /usr/local/share/npm/lib/node_modules/wicked/config/jsdocrc.json returned with code 8
ERR! wicked     at ChildProcess.<anonymous> (/usr/local/share/npm/lib/node_modules/wicked/lib/run.js:46:15)
ERR! wicked     at ChildProcess.EventEmitter.emit (events.js:98:17)
ERR! wicked     at maybeClose (child_process.js:735:16)
ERR! wicked     at Process.ChildProcess._handle.onexit (child_process.js:802:5)] stdout: '', stderr: '\n' }

The error from JSDoc directly is:

13:15:50 ~/src/.../jsxhint/test:master ✔
↳ jsdoc .

/usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:3872
            throw e;
                  ^
Error: Line 8: Unexpected token <
    at throwError (/usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:1156:21)
    at throwUnexpected (/usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:1213:9)
    at parsePrimaryExpression (/usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:1567:16)
    at /usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:3609:38
    at trackLeftHandSideExpressionAllowCall (/usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:3504:61)
    at parsePostfixExpression (/usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:1703:20)
    at /usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:3609:38
    at parseUnaryExpression (/usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:1784:16)
    at /usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:3609:38
    at parseMultiplicativeExpression (/usr/local/share/npm/lib/node_modules/jsdoc/node_modules/esprima/esprima.js:1790:20)
@landau
Copy link

landau commented Dec 27, 2013

+1

@thlorenz
Copy link
Owner

wicked now prints all details that jsdoc gives me (which is still not enough).

Please open an issue on jsdoc to get them to provide more detailed errors.

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

3 participants