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' );
11 grunt.loadNpmTasks( 'grunt-jsonlint' );
13 grunt.file.setBase( __dirname + '/../..' );
16 pkg: grunt.file.readJSON( __dirname + '/package.json' ),
21 all: [ '*.js', '{includes,languages,resources,skins,tests}/**/*.js' ]
25 // - https://github.com/mdevils/node-jscs/issues/277
26 // - https://github.com/mdevils/node-jscs/issues/278
29 // Auto-generated file with JSON (double quotes)
30 '!tests/qunit/data/mediawiki.jqueryMsg.data.js'
32 // Exclude all files ignored by jshint
33 ].concat( grunt.file.read( '.jshintignore' ).split( '\n' ).reduce( function ( patterns, pattern ) {
34 // Filter out empty lines
35 if ( pattern.length && pattern[0] !== '#' ) {
36 patterns.push( '!' + pattern );
44 '{languages,languages,maintenance,resources}/**/*.json',
45 'tests/frontend/package.json'
49 core: 'languages/i18n/',
50 installer: 'includes/installer/i18n/'
55 '<%= jsonlint.all %>',
63 grunt.registerTask( 'lint', ['jshint', 'jscs', 'jsonlint', 'banana'] );
64 grunt.registerTask( 'test', ['lint'] );
65 grunt.registerTask( 'default', ['test'] );