6 module
.exports = function ( grunt
) {
7 grunt
.loadNpmTasks( 'grunt-contrib-jshint' );
8 grunt
.loadNpmTasks( 'grunt-banana-checker' );
9 grunt
.loadNpmTasks( 'grunt-contrib-watch' );
10 grunt
.loadNpmTasks( 'grunt-jscs-checker' );
12 grunt
.file
.setBase( __dirname
+ '/../..' );
15 pkg
: grunt
.file
.readJSON( __dirname
+ '/package.json' ),
20 all
: [ '*.js', '{includes,languages,resources,skins,tests}/**/*.js' ]
24 // - https://github.com/mdevils/node-jscs/issues/277
25 // - https://github.com/mdevils/node-jscs/issues/278
28 // Auto-generated file with JSON (double quotes)
29 '!tests/qunit/data/mediawiki.jqueryMsg.data.js'
31 // Exclude all files ignored by jshint
32 ].concat( grunt
.file
.read( '.jshintignore' ).split( '\n' ).reduce( function ( patterns
, pattern
) {
33 // Filter out empty lines
34 if ( pattern
.length
&& pattern
[0] !== '#' ) {
35 patterns
.push( '!' + pattern
);
41 core
: 'languages/i18n/',
42 installer
: 'includes/installer/i18n/'
46 '.{jshintrc,jscs.json,jshintignore,csslintrc}',
53 grunt
.registerTask( 'lint', ['jshint', 'jscs', 'banana'] );
54 grunt
.registerTask( 'test', ['lint'] );
55 grunt
.registerTask( 'default', ['test'] );