/*jshint node:true */
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
- grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
- grunt.loadNpmTasks( 'grunt-jscs-checker' );
+ grunt.loadNpmTasks( 'grunt-banana-checker' );
+ grunt.loadNpmTasks( 'grunt-jscs' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.file.setBase( __dirname + '/../..' );
pkg: grunt.file.readJSON( __dirname + '/package.json' ),
jshint: {
options: {
- jshintrc: '.jshintrc'
+ jshintrc: true
},
- all: [ '*.js', '{includes,languages,resources,skins,tests}/**/*.js' ]
+ all: [
+ '*.js',
+ '{includes,languages,resources,skins,tests}/**/*.js'
+ ]
},
jscs: {
- // Known issues:
- // - https://github.com/mdevils/node-jscs/issues/277
- // - https://github.com/mdevils/node-jscs/issues/278
all: [
'<%= jshint.all %>',
// Auto-generated file with JSON (double quotes)
- '!tests/qunit/data/mediawiki.jqueryMsg.data.js'
+ '!tests/qunit/data/mediawiki.jqueryMsg.data.js',
+ // Skip functions are stored as script files but wrapped in a function when
+ // executed. node-jscs trips on the would-be "Illegal return statement".
+ '!resources/src/*-skip.js'
// Exclude all files ignored by jshint
].concat( grunt.file.read( '.jshintignore' ).split( '\n' ).reduce( function ( patterns, pattern ) {
'.jshintignore',
'.jshintrc'
],
- tasks: ['test']
+ tasks: 'test'
}
} );