2016-01-10 17:58:21 +00:00
|
|
|
/*!
|
|
|
|
* Grunt file
|
|
|
|
*
|
|
|
|
* @package CookieWarning
|
|
|
|
*/
|
|
|
|
|
2018-03-22 20:20:28 +00:00
|
|
|
/* eslint-env node */
|
2016-01-10 17:58:21 +00:00
|
|
|
module.exports = function ( grunt ) {
|
|
|
|
var conf = grunt.file.readJSON( 'extension.json' );
|
|
|
|
|
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2018-03-22 20:20:28 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2018-11-24 21:46:35 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2016-01-10 17:58:21 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
|
|
|
banana: conf.MessagesDirs,
|
|
|
|
jsonlint: {
|
|
|
|
all: [
|
|
|
|
'**/*.json',
|
2017-11-10 19:23:27 +00:00
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2016-01-10 17:58:21 +00:00
|
|
|
]
|
|
|
|
},
|
2018-03-22 20:20:28 +00:00
|
|
|
eslint: {
|
2019-08-01 23:21:12 +00:00
|
|
|
options: {
|
|
|
|
cache: true,
|
|
|
|
reportUnusedDisableDirectives: true
|
|
|
|
},
|
2016-01-10 17:58:21 +00:00
|
|
|
all: [
|
2018-03-22 20:20:28 +00:00
|
|
|
'**/*.js',
|
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2016-01-10 17:58:21 +00:00
|
|
|
]
|
|
|
|
},
|
2018-11-24 21:46:35 +00:00
|
|
|
stylelint: {
|
2016-01-10 17:58:21 +00:00
|
|
|
options: {
|
2018-11-24 21:46:35 +00:00
|
|
|
syntax: 'less'
|
2016-01-10 17:58:21 +00:00
|
|
|
},
|
2018-11-24 21:46:35 +00:00
|
|
|
src: [ 'resources/**/*.{css,less}' ]
|
2016-01-10 17:58:21 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2018-11-24 21:46:35 +00:00
|
|
|
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
|
2016-01-10 17:58:21 +00:00
|
|
|
grunt.registerTask( 'test', [ 'lint', 'banana' ] );
|
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|