mediawiki-extensions-Popups/Gruntfile.js
Kunal Mehta 8cee30c389 build: Remove maxWarnings: 0 from eslint configuration
This interferes with LibUp's ability to automatically downgrade newly failing
errors to warnings and is a deviation from the settings we typically use.

Bug: T263922
Change-Id: I77cede5ed5d0d3fee9676fc9a0f2a7872d97dd62
2020-12-28 21:56:11 -08:00

74 lines
1.5 KiB
JavaScript

/* eslint-evn node */
module.exports = function ( grunt ) {
const conf = grunt.file.readJSON( 'extension.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.loadNpmTasks( 'grunt-svgmin' );
grunt.initConfig( {
banana: conf.MessagesDirs,
eslint: {
options: {
cache: true,
fix: grunt.option( 'fix' )
},
all: {
src: [
'*.{js,json}',
'src/**/*.{js,json}',
'tests/**/*.{js,json}',
// Lint the built artifacts with ES5 so that no ES6 slips to production
'resources/dist/*.js'
]
}
},
stylelint: {
options: {
syntax: 'less',
fix: grunt.option( 'fix' )
},
all: [
'src/**/*.less'
]
},
// SVG Optimization
svgmin: {
options: grunt.file.readJSON( '.svgo.json' ),
all: {
files: [ {
expand: true,
cwd: 'resources/ext.popups.images',
src: [
'**/*.svg'
],
dest: 'resources/ext.popups.images/',
ext: '.svg'
} ]
}
},
watch: {
options: {
interrupt: true,
debounceDelay: 1000
},
lint: {
files: [ 'resources/ext.popups.main/**/*.less', 'resources/**/*.js' ],
tasks: [ 'lint' ]
},
configFiles: {
files: [ 'Gruntfile.js' ],
options: {
reload: true
}
}
}
} );
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'banana', 'svgmin' ] );
grunt.registerTask( 'default', [ 'lint' ] );
};