Skip to content

Commit

Permalink
Merge 5e44eee into cc49ed4
Browse files Browse the repository at this point in the history
  • Loading branch information
jamestalmage committed May 6, 2016
2 parents cc49ed4 + 5e44eee commit 537403e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
10 changes: 7 additions & 3 deletions cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ var meow = require('meow');
var path = require('path');
var formatterPretty = require('eslint-formatter-pretty');
var xo = require('./');
var exit = require('exit');

var cli = meow({
help: [
Expand Down Expand Up @@ -83,7 +84,8 @@ function log(report) {
var reporter = opts.reporter ? xo.getFormatter(opts.reporter) : formatterPretty;

process.stdout.write(reporter(report.results));
process.exit(report.errorCount === 0 ? 0 : 1);

exit(report.errorCount === 0 ? 0 : 1);
}

function open(report) {
Expand Down Expand Up @@ -157,12 +159,14 @@ if (opts.init) {
getStdin().then(function (str) {
if (opts.fix) {
console.error('The `fix` option is not supported on stdin');
process.exit(1);
exit(1);
return;
}

if (opts.open) {
console.error('The `open` option is not supported on stdin');
process.exit(1);
exit(1);
return;
}

log(xo.lintText(str, opts));
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@
"eslint-plugin-no-use-extend-native": "^0.3.2",
"eslint-plugin-promise": "^1.1.0",
"eslint-plugin-xo": "^0.3.1",
"exit": "^0.1.2",
"get-stdin": "^5.0.0",
"globby": "^4.0.0",
"has-flag": "^2.0.0",
Expand Down

0 comments on commit 537403e

Please sign in to comment.