2016-10-28 18:11:26 +00:00
|
|
|
/* eslint-env node */
|
2015-06-20 04:54:10 +00:00
|
|
|
module.exports = function ( grunt ) {
|
2017-01-23 13:48:11 +00:00
|
|
|
var conf = grunt.file.readJSON( 'extension.json' );
|
|
|
|
|
2015-06-20 04:54:10 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2016-10-28 18:11:26 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2015-06-20 04:54:10 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2015-09-14 18:46:13 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2016-05-19 17:06:34 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2015-06-20 04:54:10 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
2017-01-23 13:48:11 +00:00
|
|
|
banana: conf.MessagesDirs,
|
2015-06-20 04:54:10 +00:00
|
|
|
jsonlint: {
|
|
|
|
all: [
|
|
|
|
'**/*.json',
|
2017-08-19 07:58:39 +00:00
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2015-06-20 04:54:10 +00:00
|
|
|
]
|
2015-09-14 18:46:13 +00:00
|
|
|
},
|
2016-05-19 17:06:34 +00:00
|
|
|
stylelint: {
|
2017-04-28 16:33:25 +00:00
|
|
|
all: [
|
|
|
|
'**/*.css',
|
2017-08-19 07:58:39 +00:00
|
|
|
'!node_modules/**',
|
|
|
|
'!vendor/**'
|
2017-04-28 16:33:25 +00:00
|
|
|
]
|
2015-09-14 18:46:13 +00:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
files: [
|
2017-08-19 07:58:39 +00:00
|
|
|
'.{stylelintrc,.eslintrc}.json',
|
2017-04-28 16:33:08 +00:00
|
|
|
'<%= eslint.all %>',
|
2017-04-28 16:33:25 +00:00
|
|
|
'<%= stylelint.all %>'
|
2015-09-14 18:46:13 +00:00
|
|
|
],
|
|
|
|
tasks: 'test'
|
|
|
|
},
|
2016-10-28 18:11:26 +00:00
|
|
|
eslint: {
|
2017-04-28 16:33:08 +00:00
|
|
|
all: [
|
2016-10-28 18:11:26 +00:00
|
|
|
'*.js',
|
|
|
|
'modules/**/*.js',
|
2017-08-19 07:58:39 +00:00
|
|
|
'!**/node_modules/**',
|
|
|
|
'!vendor/**'
|
2016-10-28 18:11:26 +00:00
|
|
|
]
|
2015-06-20 04:54:10 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2017-04-28 16:33:08 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
|
2015-06-20 04:54:10 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|