mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-30 19:04:19 +00:00
bb26bc47b4
The following rules are failing and were disabled: * brace-style * camelcase * eqeqeq * new-cap * no-alert * no-console * no-constant-condition * no-dupe-keys * no-empty * no-implicit-globals * no-jquery/no-global-selector * no-jquery/variable-pattern * no-mixed-spaces-and-tabs * no-redeclare * no-tabs * no-undef * no-underscore-dangle * no-unused-vars * no-use-before-define * no-useless-concat * one-var * valid-jsdoc * vars-on-top Additional changes: * Added .eslintcache to .gitignore. * Removing manual reportUnusedDisableDirectives for eslint. Change-Id: I2b54baa20980b7efa3e432ed5d95fa9bc0ba7e40
70 lines
1.2 KiB
JavaScript
70 lines
1.2 KiB
JavaScript
/* eslint-env node */
|
|
|
|
module.exports = function ( grunt ) {
|
|
var conf = grunt.file.readJSON( 'extension.json' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
|
grunt.loadNpmTasks( 'grunt-svgmin' );
|
|
|
|
grunt.initConfig( {
|
|
banana: conf.MessagesDirs,
|
|
eslint: {
|
|
options: {
|
|
extensions: [ '.js', '.json' ],
|
|
cache: true
|
|
},
|
|
all: [
|
|
'**/*.{js,json}',
|
|
'!{vendor,node_modules,docs}/**'
|
|
]
|
|
},
|
|
stylelint: {
|
|
options: {
|
|
syntax: 'less'
|
|
},
|
|
src: 'resources/mmv/**/*.{css,less}'
|
|
},
|
|
// Image 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: 'resources',
|
|
src: [
|
|
'**/*.svg'
|
|
],
|
|
dest: 'resources/',
|
|
ext: '.svg'
|
|
} ]
|
|
}
|
|
}
|
|
} );
|
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'svgmin', 'banana' ] );
|
|
grunt.registerTask( 'default', 'test' );
|
|
};
|