build: Configure jshint, jsonlint, banan-checker & jscs

Change-Id: Ifab90f787bd2c4d8539698c3828c3486a3559bdb
This commit is contained in:
Kunal Mehta 2015-06-25 12:11:24 -07:00 committed by Jforrester
parent 95221186f4
commit 1a3fb084ba
4 changed files with 70 additions and 0 deletions

1
.jshintignore Normal file
View File

@ -0,0 +1 @@
node_modules

24
.jshintrc Normal file
View File

@ -0,0 +1,24 @@
{
// Enforcing
"bitwise": true,
"eqeqeq": true,
"freeze": true,
"latedef": true,
"noarg": true,
"nonew": true,
"undef": true,
"unused": true,
"strict": false,
// Relaxing
"es5": false,
// Environment
"browser": true,
"jquery": true,
"globals": {
"mediaWiki": false,
"OO": false
}
}

32
Gruntfile.js Normal file
View File

@ -0,0 +1,32 @@
/*jshint node:true */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-jscs' );
var conf = grunt.file.readJSON( 'skin.json' );
grunt.initConfig( {
jshint: {
options: {
jshintrc: true
},
all: [
'*.js'
]
},
jscs: {
src: '<%= jshint.all %>'
},
banana: conf.MessagesDirs,
jsonlint: {
all: [
'**/*.json',
'!node_modules/**'
]
}
} );
grunt.registerTask( 'test', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

13
package.json Normal file
View File

@ -0,0 +1,13 @@
{
"scripts": {
"test": "grunt test"
},
"devDependencies": {
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-contrib-jshint": "0.11.2",
"grunt-banana-checker": "0.2.2",
"grunt-jscs": "1.8.0",
"grunt-jsonlint": "1.0.4"
}
}