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

Fix incorrect exitCode when eslint is called with --stdin #6682

Merged
merged 1 commit into from Jul 15, 2016
Merged

Fix incorrect exitCode when eslint is called with --stdin #6682

merged 1 commit into from Jul 15, 2016

Conversation

shumphrey
Copy link
Contributor

What issue does this pull request address?
#6677

What changes did you make? (Give an overview)
I removed the exitCode variable and made each block set process.exitCode directly.

Is there anything you'd like reviewers to focus on?
Confirm the exitCode is set correctly by running

echo var a | eslint --stdin --rule no-var:error --no-eslintrc --no-ignore && echo good!

<codegood should not get echoed after this patch is applied.

Previously exitCode was set at the end of bin/eslint.js but the callback
executed for --stdin was asynchronous.
The asynchronous callback was setting exitCode after process.exitCode
had already been assigned.

This removes the exitCode variable and just gets each block to set
process.exitCode directly.

@mention-bot
Copy link

@shumphrey, thanks for your PR! By analyzing the annotation information on this pull request, we identified @nzakas, @ilyavolodin and @alberto to be potential reviewers

@eslintbot
Copy link

Thanks for the pull request, @shumphrey! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.
  • Pull requests with code require an issue to be mentioned at the end of the commit summary, such as (fixes #1234). Please update the commit summary with an issue (file a new issue if one doesn't already exist).

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

@eslintbot
Copy link

Thanks for the pull request, @shumphrey! I took a look to make sure it's ready for merging and found some changes are needed:

  • The commit summary needs to begin with a tag (such as Fix: or Update:). Please check out our guide for how to properly format your commit summary and update it on this pull request.
  • Pull requests with code require an issue to be mentioned at the end of the commit summary, such as (fixes #1234). Please update the commit summary with an issue (file a new issue if one doesn't already exist).

Can you please update the pull request to address these?

(More information can be found in our pull request guide.)

Previously exitCode was set at the end of bin/eslint.js but the callback
executed for --stdin was asynchronous.
The asynchronous callback was setting exitCode after process.exitCode
had already been assigned.

This removes the exitCode variable and just gets each block to set
process.exitCode directly.
@eslintbot
Copy link

LGTM

@nzakas
Copy link
Member

nzakas commented Jul 15, 2016

Lgtm.

@eslint/eslint-tsc this seems important to get fixed and released. The fix is very small so shouldn't be a problem to merge for today's release. Thoughts?

@ilyavolodin
Copy link
Member

I think we should merge it before the release.

@gyandeeps
Copy link
Member

LGTM, waiting for others to review.

@ilyavolodin ilyavolodin merged commit e8f8c6c into eslint:master Jul 15, 2016
@eslint-deprecated eslint-deprecated bot locked and limited conversation to collaborators Feb 6, 2018
@eslint-deprecated eslint-deprecated bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Feb 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
archived due to age This issue has been archived; please open a new issue for any further discussion
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants