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

no-return-wrap crash eslint on empty return statement #49

Closed
zloirock opened this issue Nov 25, 2016 · 6 comments · Fixed by singapore/lint-condo#235 or renovatebot/renovate#91
Closed

Comments

@zloirock
Copy link
Contributor

promise.then(it => {
    return;
});

=>

Cannot read property 'type' of null
TypeError: Cannot read property 'type' of null
    at EventEmitter.ReturnStatement (/Users/zloirock/wd/static/node_modules/eslint-plugin-promise/rules/no-return-wrap.js:25:28)
    at emitOne (events.js:101:20)
    at EventEmitter.emit (events.js:188:7)
    at NodeEventGenerator.enterNode (/Users/zloirock/wd/static/node_modules/eslint/lib/util/node-event-generator.js:40:22)
    at CodePathAnalyzer.enterNode (/Users/zloirock/wd/static/node_modules/eslint/lib/code-path-analysis/code-path-analyzer.js:608:23)
    at CommentEventGenerator.enterNode (/Users/zloirock/wd/static/node_modules/eslint/lib/util/comment-event-generator.js:97:23)
    at Controller.enter (/Users/zloirock/wd/static/node_modules/eslint/lib/eslint.js:925:36)
    at Controller.__execute (/Users/zloirock/wd/static/node_modules/eslint/node_modules/estraverse/estraverse.js:397:31)
    at Controller.traverse (/Users/zloirock/wd/static/node_modules/eslint/node_modules/estraverse/estraverse.js:501:28)
    at Controller.Traverser.controller.traverse (/Users/zloirock/wd/static/node_modules/eslint/lib/util/traverser.js:36:33)

Latest versions of eslint-plugin-promise, eslint, babel-eslint

@xjamundx
Copy link
Contributor

@zloirock can you take a stab at this?

xjamundx added a commit that referenced this issue Jan 9, 2017
@bonesoul
Copy link

it's still crashing eslint for me. is this resolved?

@leedm777
Copy link

leedm777 commented Feb 6, 2017

@bonesoul I can confirm that the fix works for me, but it hasn't been published to NPM yet.

@xjamundx
Copy link
Contributor

xjamundx commented Feb 6, 2017 via email

@xjamundx
Copy link
Contributor

xjamundx commented Feb 6, 2017 via email

@leedm777
Copy link

leedm777 commented Feb 6, 2017

@xjamundx That's some awesome response time. Thanks!

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