mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-12 00:48:46 +00:00
c14f7488b3
Since I9bff880de792da756f14726042df0a0df4139d1b Change-Id: I7a6625c53a26cb59518fab304b989fbd36273bc1
75 lines
1.5 KiB
JavaScript
75 lines
1.5 KiB
JavaScript
/* eslint-env node */
|
|
module.exports = function ( grunt ) {
|
|
var conf = grunt.file.readJSON( 'skin.json' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
|
grunt.loadNpmTasks( 'grunt-notify' );
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
|
|
|
grunt.initConfig( {
|
|
eslint: {
|
|
options: {
|
|
cache: true,
|
|
maxWarnings: 0,
|
|
reportUnusedDisableDirectives: true
|
|
},
|
|
all: [
|
|
'**/*.js',
|
|
'!docs/**',
|
|
'!libs/**',
|
|
'!node_modules/**',
|
|
'!vendor/**'
|
|
]
|
|
},
|
|
stylelint: {
|
|
options: {
|
|
syntax: 'less'
|
|
},
|
|
all: [
|
|
'**/*.css',
|
|
'**/*.less',
|
|
// TODO: Nested imports cause stylelint to crash
|
|
'!resources/skins.minerva.base.styles/print/styles.less',
|
|
'!docs/**',
|
|
'!libs/**',
|
|
'!node_modules/**',
|
|
'!vendor/**'
|
|
]
|
|
},
|
|
jsonlint: {
|
|
all: [
|
|
'**/*.json',
|
|
'!docs/**',
|
|
'!libs/**',
|
|
'!node_modules/**',
|
|
'!vendor/**'
|
|
]
|
|
},
|
|
banana: conf.MessagesDirs,
|
|
watch: {
|
|
lint: {
|
|
files: [ '{resources,tests/qunit}/**/*.{js,less}' ],
|
|
tasks: [ 'lint' ]
|
|
},
|
|
scripts: {
|
|
files: [ '{resources,tests/qunit}/**/*.js' ],
|
|
tasks: [ 'test' ]
|
|
},
|
|
configFiles: {
|
|
files: [ 'Gruntfile.js' ],
|
|
options: {
|
|
reload: true
|
|
}
|
|
}
|
|
}
|
|
} );
|
|
|
|
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
|
|
grunt.registerTask( 'test', [ 'lint' ] );
|
|
|
|
grunt.registerTask( 'default', [ 'test' ] );
|
|
};
|