mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-30 18:45:07 +00:00
67bf58a489
SVGO v2.x changed configuration to JS, amending configuration. Adding new 'minify-svg' npm script. Also re-crushing SVGs. Bug: T278656 Change-Id: I5b150cce300e764afb0a40d402479db22cfcea99
49 lines
1.1 KiB
JavaScript
49 lines
1.1 KiB
JavaScript
/* eslint-env node, es6 */
|
||
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-stylelint' );
|
||
|
||
grunt.initConfig( {
|
||
eslint: {
|
||
options: {
|
||
cache: true,
|
||
fix: grunt.option( 'fix' )
|
||
},
|
||
all: [
|
||
'**/*.{js,json}',
|
||
'!{tests/externals,docs}/**',
|
||
'!{vendor,node_modules}/**'
|
||
]
|
||
},
|
||
// Lint – Styling
|
||
stylelint: {
|
||
options: {
|
||
syntax: 'less'
|
||
},
|
||
all: [
|
||
'modules/**/*.{css,less}'
|
||
]
|
||
},
|
||
// eslint-disable-next-line es/no-object-assign, compat/compat
|
||
banana: Object.assign( {
|
||
options: { requireLowerCase: false }
|
||
}, conf.MessagesDirs ),
|
||
watch: {
|
||
files: [
|
||
'.{stylelintrc,eslintrc}.json',
|
||
'<%= eslint.all %>',
|
||
'<%= stylelint.all %>'
|
||
],
|
||
tasks: 'test'
|
||
}
|
||
} );
|
||
|
||
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'banana' ] );
|
||
grunt.registerTask( 'test', 'lint' );
|
||
grunt.registerTask( 'default', [ 'test' ] );
|
||
};
|