2015-05-29 14:52:06 +00:00
|
|
|
/*!
|
|
|
|
* Grunt file
|
|
|
|
*
|
|
|
|
* @package SyntaxHighlight_GeSHi
|
|
|
|
*/
|
|
|
|
|
2016-11-19 13:56:05 +00:00
|
|
|
/* eslint-env node */
|
2015-05-29 14:52:06 +00:00
|
|
|
module.exports = function ( grunt ) {
|
2017-01-23 14:10:18 +00:00
|
|
|
var conf = grunt.file.readJSON( 'extension.json' );
|
|
|
|
|
2015-05-29 14:52:06 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2016-11-19 13:56:05 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2015-05-29 14:52:06 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2016-05-18 13:28:55 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2015-05-29 14:52:06 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
2016-11-19 13:56:05 +00:00
|
|
|
eslint: {
|
2015-05-29 14:52:06 +00:00
|
|
|
all: [
|
|
|
|
'*.js',
|
|
|
|
'modules/**/*.js'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
jsonlint: {
|
|
|
|
all: [
|
|
|
|
'*.json',
|
|
|
|
'i18n/*.json',
|
|
|
|
'modules/**/*.json'
|
|
|
|
]
|
|
|
|
},
|
2016-05-18 13:28:55 +00:00
|
|
|
stylelint: {
|
2016-05-20 12:58:01 +00:00
|
|
|
all: [
|
2016-05-18 13:28:55 +00:00
|
|
|
'**/*.css',
|
|
|
|
'!**/*.generated.css',
|
|
|
|
'!vendor/**',
|
|
|
|
'!node_modules/**'
|
|
|
|
]
|
2015-05-27 16:15:00 +00:00
|
|
|
},
|
2017-01-23 14:10:18 +00:00
|
|
|
banana: conf.MessagesDirs,
|
2015-05-29 14:52:06 +00:00
|
|
|
watch: {
|
|
|
|
files: [
|
2016-05-18 13:28:55 +00:00
|
|
|
'.{stylelintrc,jscsrc,jshintignore,jshintrc}',
|
2016-11-19 13:56:05 +00:00
|
|
|
'<%= eslint.all %>',
|
2016-05-18 13:28:55 +00:00
|
|
|
'<%= stylelint.all %>'
|
2015-05-29 14:52:06 +00:00
|
|
|
],
|
|
|
|
tasks: 'test'
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2016-11-19 13:56:05 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'stylelint', 'banana' ] );
|
2015-05-29 14:52:06 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|