mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 15:16:50 +00:00
3c892ca9f8
Run `npm run lint:fix` to use Change-Id: I445c17a57b5f240ddaa48956d7881cc3228eab76
82 lines
1.5 KiB
JavaScript
82 lines
1.5 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: {
|
|
options: {
|
|
maxWarnings: 0
|
|
},
|
|
// Lint the built artifacts with ES5 so that no ES6 slips to production
|
|
build: {
|
|
options: {
|
|
configFile: '.eslintrc.es5.json'
|
|
},
|
|
src: [
|
|
'resources/dist/*.js'
|
|
]
|
|
},
|
|
sources: {
|
|
src: [
|
|
'src/**/*.js',
|
|
'tests/node-qunit/**/*.js'
|
|
]
|
|
},
|
|
sourcesfix: {
|
|
options: {
|
|
fix: true
|
|
},
|
|
src: [
|
|
'src/**/*.js',
|
|
'tests/node-qunit/**/*.js'
|
|
]
|
|
}
|
|
},
|
|
jsonlint: {
|
|
all: [
|
|
'*.json',
|
|
'**/*.json',
|
|
'!docs/**',
|
|
'!node_modules/**',
|
|
'!vendor/**'
|
|
]
|
|
},
|
|
stylelint: {
|
|
options: {
|
|
syntax: 'less'
|
|
},
|
|
all: [
|
|
'resources/ext.popups.main/**/*.less'
|
|
]
|
|
},
|
|
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( 'fix', [ 'eslint:sourcesfix' ] );
|
|
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'jsonlint', 'banana', 'eslint:build' ] );
|
|
grunt.registerTask( 'default', [ 'lint' ] );
|
|
};
|