2014-06-04 02:34:04 +00:00
|
|
|
/*!
|
|
|
|
* Grunt file
|
|
|
|
*
|
|
|
|
* @package TemplateData
|
|
|
|
*/
|
|
|
|
|
|
|
|
/*jshint node:true */
|
|
|
|
module.exports = function ( grunt ) {
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-csslint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2015-06-12 04:46:56 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2014-06-04 02:34:04 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2015-06-06 01:21:18 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-jscs' );
|
2015-05-29 19:38:41 +00:00
|
|
|
var conf = grunt.file.readJSON( 'extension.json' );
|
2014-06-04 02:34:04 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
|
|
|
jshint: {
|
|
|
|
options: {
|
|
|
|
jshintrc: true
|
|
|
|
},
|
|
|
|
all: [
|
|
|
|
'modules/*.js',
|
|
|
|
'tests/*.js'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
jscs: {
|
|
|
|
src: '<%= jshint.all %>'
|
|
|
|
},
|
|
|
|
csslint: {
|
|
|
|
options: {
|
|
|
|
csslintrc: '.csslintrc'
|
|
|
|
},
|
|
|
|
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: [
|
|
|
|
'.{csslintrc,jscsrc,jshintignore,jshintrc}',
|
|
|
|
'<%= jshint.all %>',
|
|
|
|
'<%= csslint.all %>'
|
|
|
|
],
|
|
|
|
tasks: 'test'
|
2015-06-12 04:46:56 +00:00
|
|
|
},
|
|
|
|
jsonlint: {
|
|
|
|
all: [
|
|
|
|
'**/*.json',
|
|
|
|
'!node_modules/**'
|
|
|
|
]
|
2014-06-04 02:34:04 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2015-06-12 04:46:56 +00:00
|
|
|
grunt.registerTask( 'test', [ 'jshint', 'jscs', 'csslint', 'jsonlint', 'banana' ] );
|
2014-06-04 02:34:04 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|