mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-24 14:23:53 +00:00
a32999e641
Change-Id: Icabf6e065ed5685207731262db72faf848a0a04d
65 lines
1.4 KiB
JavaScript
65 lines
1.4 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-notify' );
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
|
|
|
grunt.initConfig( {
|
|
eslint: {
|
|
options: {
|
|
cache: true,
|
|
extensions: [ '.js', '.json' ],
|
|
maxWarnings: 0,
|
|
reportUnusedDisableDirectives: true
|
|
},
|
|
all: [
|
|
'**/*.{js,json}',
|
|
'!docs/**',
|
|
'!libs/**',
|
|
'!node_modules/**',
|
|
'!vendor/**'
|
|
]
|
|
},
|
|
stylelint: {
|
|
all: [
|
|
'**/*.{css,less}',
|
|
// TODO: Nested imports cause stylelint to crash
|
|
'!resources/skins.minerva.base.styles/print/styles.less',
|
|
'!docs/**',
|
|
'!libs/**',
|
|
'!node_modules/**',
|
|
'!vendor/**'
|
|
]
|
|
},
|
|
// eslint-disable-next-line es/no-object-assign
|
|
banana: Object.assign( {
|
|
options: { requireLowerCase: false }
|
|
}, 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', 'banana' ] );
|
|
grunt.registerTask( 'test', [ 'lint' ] );
|
|
|
|
grunt.registerTask( 'default', [ 'test' ] );
|
|
};
|