6 module
.exports = function ( grunt
) {
7 grunt
.loadNpmTasks( 'grunt-contrib-jshint' );
8 grunt
.loadNpmTasks( 'grunt-contrib-watch' );
9 grunt
.loadNpmTasks( 'grunt-banana-checker' );
10 grunt
.loadNpmTasks( 'grunt-jscs' );
11 grunt
.loadNpmTasks( 'grunt-jsonlint' );
13 grunt
.file
.setBase( __dirname
+ '/../..' );
16 pkg
: grunt
.file
.readJSON( __dirname
+ '/package.json' ),
23 '{includes,languages,resources,skins,tests}/**/*.js'
29 // Auto-generated file with JSON (double quotes)
30 '!tests/qunit/data/mediawiki.jqueryMsg.data.js',
31 // Skip functions are stored as script files but wrapped in a function when
32 // executed. node-jscs trips on the would-be "Illegal return statement".
33 '!resources/src/*-skip.js'
35 // Exclude all files ignored by jshint
36 ].concat( grunt
.file
.read( '.jshintignore' ).split( '\n' ).reduce( function ( patterns
, pattern
) {
37 // Filter out empty lines
38 if ( pattern
.length
&& pattern
[0] !== '#' ) {
39 patterns
.push( '!' + pattern
);
47 '{languages,maintenance,resources}/**/*.json',
48 'tests/frontend/package.json'
52 core
: 'languages/i18n/',
53 api
: 'includes/api/i18n/',
54 installer
: 'includes/installer/i18n/'
59 '<%= jsonlint.all %>',
67 grunt
.registerTask( 'lint', ['jshint', 'jscs', 'jsonlint', 'banana'] );
68 grunt
.registerTask( 'test', ['lint'] );
69 grunt
.registerTask( 'default', ['test'] );