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

Depcheck is busted #11

Closed
goldibex opened this issue Sep 5, 2014 · 6 comments · Fixed by #12
Closed

Depcheck is busted #11

goldibex opened this issue Sep 5, 2014 · 6 comments · Fixed by #12

Comments

@goldibex
Copy link

goldibex commented Sep 5, 2014

❯ depcheck myapp

/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:6268
            throw e;
                  ^
Error: Line 51663: Invalid regular expression
    at throwError (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2159:21)
    at scanRegExp (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:1343:13)
    at parsePrimaryExpression (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2665:43)
    at parseLeftHandSideExpressionAllowCall (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2755:61)
    at parsePostfixExpression (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2795:20)
    at parseUnaryExpression (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2859:16)
    at parseBinaryExpression (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2947:16)
    at parseConditionalExpression (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2994:16)
    at parseAssignmentExpression (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:3179:16)
    at parseSpreadOrAssignmentExpression (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2711:16)
    at parseArguments (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2688:23)
    at parseLeftHandSideExpressionAllowCall (/usr/local/lib/node_modules/depcheck/node_modules/detective/node_modules/esprima-fb/esprima.js:2759:24)
@rumpl
Copy link
Member

rumpl commented Sep 6, 2014

Hey,

This is esprima telling you that there is an invalid RegExp in your code.

I'm not sure if depcheck should catch this kind of errors, it's not its job to do so.

Or maybe just say that it cannot parse the code ?

@dylang
Copy link
Contributor

dylang commented Sep 7, 2014

I submitted pull request #12 that will fix the code to catch the error Esprima is throwing so depcheck won't fail.

@goldibex
Copy link
Author

goldibex commented Sep 8, 2014

After some investigation I've determined that depcheck is breaking because of a file in bower_components. Depcheck shouldn't look in places like that. Could you possibly add some kind of blacklisting or whitelisting option?

Thanks again for a really cool tool.

@dylang
Copy link
Contributor

dylang commented Sep 9, 2014

Great point @goldibex. I added bower_components to the list of default ignored directories in my pull request.

There's also an example of how to do it yourself in the readme.

@rumpl rumpl closed this as completed in #12 Sep 9, 2014
@rumpl
Copy link
Member

rumpl commented Sep 9, 2014

Merged, closed. Thanks @dylang, and thank you @goldibex for using this tool! :)

New version coming soon.

@rumpl
Copy link
Member

rumpl commented Sep 9, 2014

Aaaaand done, you can update depcheck on npm.

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

Successfully merging a pull request may close this issue.

3 participants