2014-06-04 02:34:04 +00:00
|
|
|
/*!
|
|
|
|
* Grunt file
|
|
|
|
*
|
|
|
|
* @package TemplateData
|
|
|
|
*/
|
|
|
|
|
2016-12-02 22:05:13 +00:00
|
|
|
/* eslint-env node */
|
2014-06-04 02:34:04 +00:00
|
|
|
module.exports = function ( grunt ) {
|
2015-09-17 20:10:33 +00:00
|
|
|
var conf = grunt.file.readJSON( 'extension.json' );
|
|
|
|
|
2016-05-24 14:25:25 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2014-06-04 02:34:04 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2016-12-02 22:05:13 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2016-05-19 19:17:39 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2014-06-04 02:34:04 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
2016-12-02 22:05:13 +00:00
|
|
|
eslint: {
|
2019-02-10 17:06:49 +00:00
|
|
|
options: {
|
2019-03-13 23:16:58 +00:00
|
|
|
reportUnusedDisableDirectives: true,
|
2019-05-07 17:50:20 +00:00
|
|
|
extensions: [ '.js', '.json' ],
|
2019-03-13 23:16:58 +00:00
|
|
|
cache: true
|
2019-02-10 17:06:49 +00:00
|
|
|
},
|
2014-06-04 02:34:04 +00:00
|
|
|
all: [
|
2019-05-07 17:50:20 +00:00
|
|
|
'**/*.js{,on}',
|
|
|
|
'!{lib,vendor,node_modules}/**'
|
2014-06-04 02:34:04 +00:00
|
|
|
]
|
|
|
|
},
|
2016-05-19 19:17:39 +00:00
|
|
|
stylelint: {
|
2014-06-04 02:34:04 +00:00
|
|
|
all: [
|
|
|
|
'modules/*.css',
|
|
|
|
'resources/*.css'
|
|
|
|
]
|
|
|
|
},
|
2015-05-29 19:38:41 +00:00
|
|
|
banana: conf.MessagesDirs,
|
2014-06-04 02:34:04 +00:00
|
|
|
watch: {
|
|
|
|
files: [
|
2017-08-19 08:35:07 +00:00
|
|
|
'.{stylelintrc,eslintrc}.json',
|
2016-12-02 22:05:13 +00:00
|
|
|
'<%= eslint.all %>',
|
2016-05-19 19:17:39 +00:00
|
|
|
'<%= stylelint.all %>'
|
2014-06-04 02:34:04 +00:00
|
|
|
],
|
|
|
|
tasks: 'test'
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2019-05-07 17:50:20 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );
|
2014-06-04 02:34:04 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|