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-24 14:25:25 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
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: {
|
2014-06-04 02:34:04 +00:00
|
|
|
all: [
|
2016-02-19 13:19:00 +00:00
|
|
|
'modules/**/*.js',
|
|
|
|
'tests/**/*.js'
|
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'
|
|
|
|
]
|
|
|
|
},
|
2016-05-19 19:17:39 +00:00
|
|
|
jsonlint: {
|
|
|
|
all: [
|
|
|
|
'**/*.json',
|
2017-11-11 23:38:41 +00:00
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2016-05-19 19:17:39 +00:00
|
|
|
]
|
|
|
|
},
|
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'
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2016-12-02 22:05:13 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
|
2014-06-04 02:34:04 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|