mediawiki-extensions-Popups/Gruntfile.js
joakin 2516299bd2 Hygiene: Lint JS files on tests/node-qunit too
For consistency.

Bug: T160406
Change-Id: I2fd67649e9dc4bdb3b963b8ee70ed0234dbcb5ce
2017-04-26 12:34:12 +02:00

70 lines
1.3 KiB
JavaScript

/* eslint-evn node */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
banana: conf.MessagesDirs,
eslint: {
fix: {
options: {
fix: true
},
src: [
'<%= eslint.all %>'
]
},
all: [
'src/**',
'resources/ext.popups/*.js',
'resources/ext.popups/**/*.js',
'tests/node-qunit/**/*.js',
'!resources/dist/index.js',
'!docs/**',
'!node_modules/**'
]
},
jsonlint: {
all: [
'*.json',
'**/*.json',
'!docs/**',
'!node_modules/**'
]
},
stylelint: {
options: {
syntax: 'less'
},
all: [
'resources/ext.popups/**/*.less'
]
},
watch: {
options: {
interrupt: true,
debounceDelay: 1000
},
lint: {
files: [ 'resources/ext.popups/**/*.less', 'resources/**/*.js' ],
tasks: [ 'lint' ]
},
configFiles: {
files: [ 'Gruntfile.js' ],
options: {
reload: true
}
}
}
} );
grunt.registerTask( 'lint', [ 'eslint:all', 'stylelint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', [ 'lint' ] );
};