Skip to content

Commit

Permalink
separate jshint config for specs
Browse files Browse the repository at this point in the history
specs need a separate jshintrc, since chai needs '"expr": true' option
because of chaijs/chai#41
  • Loading branch information
johnyb committed May 6, 2014
1 parent a2594f3 commit e701e45
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 3 deletions.
13 changes: 10 additions & 3 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,16 @@ module.exports = function (grunt) {
},
all: [
'Gruntfile.js',
'lib/**/*.js',
'spec/**/*.js'
]
'lib/**/*.js'
],
specs: {
options: {
jshintrc: 'spec/.jshintrc'
},
files: [{
src: ['spec/**/*.js']
}]
}
},
mochaTest: {
tests: {
Expand Down
39 changes: 39 additions & 0 deletions spec/.jshintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
// JSHint Configuration File
// See http://jshint.com/docs/ for more details

"maxerr" : 5, // {int} Maximum error before stopping

// Enforcing
"bitwise" : false, // true: Prohibit bitwise operators (&, |, ^, etc.)
"forin" : false, // true: Require filtering for..in loops with obj.hasOwnProperty()
"immed" : true, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`,
"quotmark" : "single",
"undef" : true,
"unused" : true,

// Relaxing
"debug" : true, // true: Allow debugger statements e.g. browser breakpoints.
"browser" : true, // true: defines globals exposed by modern browsers
"devel" : true, // true: define globals for some development functions (alert, console)
"shadow" : true, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
"validthis" : true, // true: Tolerate using this in a non-constructor function
"boss" : true, // true: Tolerate assignments where comparisons would be expected
"evil" : true, // true: Tolerate use of `eval` and `new Function()`
"expr" : true,

// Environments

"trailing" : true, // true: Prohibit trailing whitespaces
"node" : true, // Node.js
"nonstandard" : true, // Widely adopted globals (escape, unescape, etc)

// Legacy
"white" : true, // true: Check against strict whitespace and indentation rules

// Custom Globals
"globals": {
"describe": true,
"it": true
}
}

0 comments on commit e701e45

Please sign in to comment.