Skip to content

Instantly share code, notes, and snippets.

@ryanve
Last active March 26, 2016 01:21
Show Gist options
  • Select an option

  • Save ryanve/d457a4bafcad73a4ca05 to your computer and use it in GitHub Desktop.

Select an option

Save ryanve/d457a4bafcad73a4ca05 to your computer and use it in GitHub Desktop.
grunt npm jshint demo
module.exports = function(grunt) {
var _ = grunt.util._;
var pkg = grunt.file.readJSON('package.json');
grunt.initConfig({
pkg: pkg,
jshint: {
all: ['./'], // deep
dir: ['*.js'], // shallow
sub: ['*/'], // sub dirs
lib: ['lib/'],
options: _.extend({
ignores: ['**/**/node_modules/', '**/**/vendor/', '**/**.min.js']
}, pkg.jshintConfig)
},
});
grunt.registerTask('default', ['jshint:all']);
};
{
"name": "example",
"description": "",
"version": "0.0.0",
"dependencies": {},
"devDependencies": {
"grunt-contrib-jshint": "^0.9.0"
},
"jshintConfig": {
"asi": false,
"boss": true,
"browser": true,
"debug": true,
"devel": true,
"eqnull": true,
"evil": true,
"expr": true,
"globals": {},
"jquery": true,
"lastsemic": true,
"latedef": "nofunc",
"laxcomma": true,
"maxcomplexity": 10,
"maxerr": 10,
"maxlen": 115,
"maxparams": 4,
"node": true,
"sub": true,
"supernew": true,
"trailing": true,
"undef": true,
"unused": true,
"worker": true
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment