Hi All,
I'm trying to exclude a set of files to lint while using JSHint 2.3.0 in a node.js context. I've been reading lots of documentation, PR's, etc., and I still can't seem to accomplish my goal.
On the command line this is easy with the --exclude option, or with a .jshintignore. It also seems like grunt accomplishes this by doing require('jshint/src/cli/cli'), and then calling cli.run directly. Unfortunately, when jshint is installed as an npm module it doesn't look like the cli object is exported. So basically I'm doing this:
var JSHINT = require('jshint').JSHINT;
var jshintOptions = JSON.parse(fs.readFileSync('/path/to/.jshintrc'));
var jsContent = ""+fs.readFileSync('some/path/to/file', 'utf8');
JSHINT(jsContent, jshintOptions);
var jsHintWarnings = JSHINT.errors;
Is there any way to get a list of files/directories to exclude into this workflow? Or am I doing something crazy and I should alter my approach? To give a little more context, this is for a fully node.js web app that provides statistics about our CSS/JS. Thanks!
-Jonathan