Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use grunt + .jshint to run coding standards tests
- Loading branch information
1 parent
5a49a69
commit ee4ba98
Showing
3 changed files
with
66 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,34 @@ | ||
{ | ||
"asi": true, | ||
"camelcase": true, | ||
"noempty": true, | ||
"undef": true, | ||
"unused": true, | ||
"trailing": true, | ||
"maxlen": 90, | ||
"laxcomma": true, | ||
"newcap": true, | ||
"quotmark": true, | ||
"trailing": true, | ||
"predef": [ | ||
"console", "define", "module", "require", | ||
"before", "beforeEach", "describe", "it" | ||
"asi": true, | ||
"camelcase": true, | ||
"eqeqeq": true, | ||
"eqnull": true, | ||
"globalstrict": true, | ||
"immed": true, | ||
"indent": 4, | ||
"latedef": "nofunc", | ||
"laxcomma": true, | ||
"maxparams": 4, | ||
"maxdepth": 3, | ||
"maxstatements": 20, | ||
"maxcomplexity": 12, | ||
"maxlen": 120, | ||
"newcap": true, | ||
"noarg": true, | ||
"noempty": true, | ||
"nonew": true, | ||
"quotmark": "single", | ||
"undef": true, | ||
"unused": true, | ||
"strict": true, | ||
"trailing": true, | ||
|
||
"node": true, | ||
|
||
"predef": [ | ||
"define", "module", "require", | ||
"before", "beforeEach", "describe", "it", | ||
"after", "window" | ||
] | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use strict'; | ||
|
||
module.exports = function(grunt) { | ||
|
||
grunt.initConfig({ | ||
pkg: grunt.file.readJSON('package.json'), | ||
jshint: { | ||
allFiles: ['Gruntfile.js', 'lib/**/*.js', 'tests/**/*.js', 'index.js'], | ||
options: { | ||
jshintrc: '.jshintrc', | ||
} | ||
}, | ||
mochacli: { | ||
all: ['test/**/*.js'], | ||
options: { | ||
reporter: 'spec', | ||
ui: 'tdd' | ||
} | ||
} | ||
}) | ||
|
||
// Load the plugins | ||
grunt.loadNpmTasks('grunt-contrib-jshint') | ||
grunt.loadNpmTasks('grunt-mocha-cli') | ||
|
||
// Configure tasks | ||
grunt.registerTask('default', ['test']) | ||
grunt.registerTask('test', ['mochacli', 'jshint']) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters