Add jshint to npm

Change-Id: I97abe62b1744611d2b5b8b3284b6b257c96a48de
This commit is contained in:
Paladox 2016-03-10 22:02:55 +00:00 committed by Hashar
parent 06fd373127
commit ad5d35cad6
4 changed files with 33 additions and 37 deletions

1
.jshintignore Normal file
View file

@ -0,0 +1 @@
node_modules

View file

@ -1,40 +1,23 @@
{
/* Common */
// Enforcing
"camelcase": true,
"curly": true,
"eqeqeq": true,
"immed": true,
"latedef": true,
"newcap": true,
"noarg": true,
"noempty": true,
"nonew": true,
"quotmark": "single",
"trailing": true,
"undef": true,
"unused": true,
// Legacy
"onevar": true,
/* Local */
// Enforcing
"bitwise": true,
"forin": false,
"regexp": false,
"strict": true,
"eqeqeq": true,
"freeze": true,
"latedef": "nofunc",
"noarg": true,
"nonew": true,
"undef": true,
"unused": true,
"strict": false,
// Relaxing
"laxbreak": true,
"smarttabs": true,
"multistr": true,
"es5": false,
// Environment
"browser": true,
"jquery": true,
"predef": [
"mediaWiki",
"jQuery",
"QUnit"
]
"globals": {
"mediaWiki": false
}
}

View file

@ -1,12 +1,23 @@
/*jshint node:true */
module.exports = function ( grunt ) {
'use strict';
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
var conf = grunt.file.readJSON( 'extension.json' );
grunt.initConfig( {
banana: conf.MessagesDirs,
jshint: {
options: {
jshintrc: true
},
all: [
'**/*.js',
'!node_modules/**',
'!lib/**'
]
},
banana: {
all: 'i18n/'
},
jsonlint: {
all: [
'**/*.json',
@ -15,6 +26,6 @@ module.exports = function ( grunt ) {
}
} );
grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

View file

@ -7,6 +7,7 @@
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt-banana-checker": "0.4.0",
"grunt-contrib-jshint": "1.0.0",
"grunt-jsonlint": "1.0.7"
}
}