6 module
.exports = function ( grunt
) {
7 grunt
.loadNpmTasks( 'grunt-contrib-jshint' );
8 grunt
.loadNpmTasks( 'grunt-contrib-watch' );
9 grunt
.loadNpmTasks( 'grunt-jscs-checker' );
11 grunt
.file
.setBase( __dirname
+ '/../..' );
14 pkg
: grunt
.file
.readJSON( __dirname
+ '/package.json' ),
19 all
: [ '*.js', '{includes,languages,resources,skins,tests}/**/*.js' ]
23 // - https://github.com/mdevils/node-jscs/issues/277
24 // - https://github.com/mdevils/node-jscs/issues/278
27 // Auto-generated file with JSON (double quotes)
28 '!tests/qunit/data/mediawiki.jqueryMsg.data.js'
30 // Exclude all files ignored by jshint
31 ].concat( grunt
.file
.read( '.jshintignore' ).split( '\n' ).reduce( function ( patterns
, pattern
) {
32 // Filter out empty lines
33 if ( pattern
.length
&& pattern
[0] !== '#' ) {
34 patterns
.push( '!' + pattern
);
41 '.{jshintrc,jscs.json,jshintignore,csslintrc}',
48 grunt
.registerTask( 'lint', ['jshint', 'jscs'] );
49 grunt
.registerTask( 'test', ['lint'] );
50 grunt
.registerTask( 'default', ['test'] );