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

ESLint crashing after upgrade to xo@0.16.0 #128

Closed
maxrimue opened this issue Jun 22, 2016 · 3 comments
Closed

ESLint crashing after upgrade to xo@0.16.0 #128

maxrimue opened this issue Jun 22, 2016 · 3 comments
Labels

Comments

@maxrimue
Copy link

I have a project where I've been using xo@0.15.0, and everything worked fine. Then, I upgraded to xo@0.16.0, and suddenly just running xo doesn't work anymore. I get the following output:

> node-autostart@3.0.1 test /Users/maxr/node-autostart
> xo && nyc mocha

TypeError: Cannot read property 'type' of undefined
    at getScopeBody (/Users/maxr/node-autostart/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:30:11)
    at /Users/maxr/node-autostart/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:104:27
    at Array.forEach (native)
    at /Users/maxr/node-autostart/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:103:22
    at Array.forEach (native)
    at EventEmitter.ProgramExit (/Users/maxr/node-autostart/node_modules/eslint-plugin-import/lib/rules/newline-after-import.js:99:14)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.leaveNode (/Users/maxr/node-autostart/node_modules/eslint/lib/util/node-event-generator.js:49:22)
    at CodePathAnalyzer.leaveNode (/Users/maxr/node-autostart/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:627:23)
    at CommentEventGenerator.leaveNode (/Users/maxr/node-autostart/node_modules/eslint/lib/util/comment-event-generator.js:110:23)
    at Controller.traverser.traverse.leave (/Users/maxr/node-autostart/node_modules/eslint/lib/eslint.js:908:36)
npm ERR! Test failed.  See above for more details.

It looks like the importing of an ESLint plugin is now failing.

My config, if important:

  "xo": {
    "space": true,
    "rules": {
      "no-unused-expressions": 0,
      "no-undef": 0,
      "xo/filename-case": 0
    }
  }

If I downgrade to xo@0.15.0, everything works, but when I upgrade again it crashes again.
The PR that involves this upgrade can be found here, and the repo here.

Thanks!

@sindresorhus
Copy link
Member

Thanks for reporting :) Looks like import-js/eslint-plugin-import#386. Would you be able to track down the problematic code and post in that thread?

@maxrimue
Copy link
Author

@sindresorhus I'll see if I can find out anything

@sindresorhus
Copy link
Member

This should already be fixed. See the linked issue.

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

No branches or pull requests

2 participants