mediawiki-extensions-Echo/Gruntfile.js
James D. Forrester 38b41c0f98 build: Upgrade eslint-config-wikimedia from 0.10.1 to 0.11.0
Change-Id: I6747b5e36f64d681b6f83461f0ebb9c9f88bea86
2019-04-03 15:57:20 -07:00

96 lines
1.8 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/* eslint-env 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.loadNpmTasks( 'grunt-svgmin' );
grunt.initConfig( {
eslint: {
options: {
reportUnusedDisableDirectives: true,
cache: true
},
src: [
'**/*.js',
'!node_modules/**',
'!vendor/**',
'!tests/externals/**',
'!docs/**'
]
},
// Lint Styling
stylelint: {
options: {
syntax: 'less'
},
all: [
'modules/**/*.css',
'modules/**/*.less'
]
},
// SVG Optimization
svgmin: {
options: {
js2svg: {
indent: '\t',
pretty: true
},
multipass: true,
plugins: [ {
cleanupIDs: false
}, {
removeDesc: false
}, {
removeRasterImages: true
}, {
removeTitle: false
}, {
removeViewBox: false
}, {
removeXMLProcInst: false
}, {
sortAttrs: true
} ]
},
all: {
files: [ {
expand: true,
cwd: 'modules/icons',
src: [
'**/*.svg'
],
dest: 'modules/icons/',
ext: '.svg'
} ]
}
},
banana: conf.MessagesDirs,
watch: {
files: [
'.{stylelintrc,eslintrc}.json',
'<%= eslint.all %>',
'<%= stylelint.all %>'
],
tasks: 'test'
},
jsonlint: {
all: [
'**/*.json',
'!node_modules/**',
'!vendor/**',
'!docs/**'
]
}
} );
grunt.registerTask( 'minify', 'svgmin' );
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', 'lint' );
grunt.registerTask( 'default', [ 'minify', 'test' ] );
};