Comparing version 0.2.11 to 0.3.0
@@ -5,2 +5,3 @@ var linter = require("./linter"); | ||
var fs = require("fs"); | ||
var glob; | ||
var con = console; | ||
@@ -13,2 +14,7 @@ var pro = process; | ||
try { | ||
glob = require("glob"); | ||
exports.glob = glob; | ||
} catch (ignore) {} | ||
exports.setConsole = function (c) { | ||
@@ -103,3 +109,4 @@ 'use strict'; | ||
var maybeExit; | ||
var maybeExit, | ||
remain = []; | ||
@@ -133,6 +140,17 @@ if (parsed.version) { | ||
if (glob) { | ||
parsed.argv.remain.forEach(function (file) { | ||
var matches = glob.sync(file).filter(function (match) { | ||
return match.indexOf('node_modules') !== 0; | ||
}); | ||
remain = remain.concat(matches); | ||
}); | ||
} else { | ||
remain = parsed.argv.remain; | ||
} | ||
// If there are no more files to be processed, exit with the value 1 | ||
// if any of the files contains any lint. | ||
maybeExit = (function () { | ||
var filesLeft = parsed.argv.remain.length, | ||
var filesLeft = remain.length, | ||
ok = true; | ||
@@ -160,3 +178,3 @@ | ||
parsed.argv.remain.forEach(lintFile); | ||
remain.forEach(lintFile); | ||
}; |
@@ -8,3 +8,3 @@ { | ||
], | ||
"version": "0.2.11", | ||
"version": "0.3.0", | ||
"author": "Reid Burke <me@reidburke.com>", | ||
@@ -22,3 +22,4 @@ "contributors": [ | ||
"Andrew Pennebaker", | ||
"Bnaya" | ||
"Bnaya", | ||
"Maximilian Antoni <mail@maxantoni.de>" | ||
], | ||
@@ -38,2 +39,5 @@ "bin": { | ||
}, | ||
"optionalDependencies": { | ||
"glob": "~3.2.8" | ||
}, | ||
"engines": { | ||
@@ -40,0 +44,0 @@ "node": ">=0.4.12" |
@@ -54,3 +54,3 @@ ## node-jslint | ||
find . -name "*.js" -print0 | xargs -0 jslint | ||
jslint '**/*.js' | ||
@@ -57,0 +57,0 @@ Using JSLint with a config file |
1128280
29947
2