2016-11-18 21:16:43 +00:00
|
|
|
|
/* eslint-env node */
|
2015-05-02 03:31:16 +00:00
|
|
|
|
module.exports = function ( grunt ) {
|
2017-01-23 13:40:14 +00:00
|
|
|
|
var conf = grunt.file.readJSON( 'extension.json' );
|
|
|
|
|
|
2016-11-18 21:16:43 +00:00
|
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
2015-05-02 03:31:16 +00:00
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2016-11-18 21:16:43 +00:00
|
|
|
|
grunt.loadNpmTasks( 'grunt-eslint' );
|
2015-06-12 04:32:18 +00:00
|
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2016-10-05 00:11:41 +00:00
|
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2015-05-02 03:31:16 +00:00
|
|
|
|
|
|
|
|
|
grunt.initConfig( {
|
2016-11-18 21:16:43 +00:00
|
|
|
|
eslint: {
|
|
|
|
|
src: [
|
2015-10-31 12:35:06 +00:00
|
|
|
|
'**/*.js',
|
2016-05-16 20:59:43 +00:00
|
|
|
|
'!node_modules/**',
|
2016-11-18 21:16:43 +00:00
|
|
|
|
'!vendor/**',
|
2016-05-16 20:59:43 +00:00
|
|
|
|
'!tests/externals/**',
|
|
|
|
|
'!docs/**'
|
2015-10-31 12:35:06 +00:00
|
|
|
|
]
|
2015-05-02 03:31:16 +00:00
|
|
|
|
},
|
2016-10-05 00:11:41 +00:00
|
|
|
|
// Lint – Styling
|
|
|
|
|
stylelint: {
|
|
|
|
|
options: {
|
|
|
|
|
syntax: 'less'
|
|
|
|
|
},
|
|
|
|
|
all: [
|
|
|
|
|
'modules/**/*.css',
|
|
|
|
|
'modules/**/*.less'
|
|
|
|
|
]
|
|
|
|
|
},
|
2017-01-23 13:40:14 +00:00
|
|
|
|
banana: conf.MessagesDirs,
|
2015-05-02 03:31:16 +00:00
|
|
|
|
watch: {
|
|
|
|
|
files: [
|
2016-11-18 21:16:43 +00:00
|
|
|
|
'.{stylelintrc,eslintrc.json}',
|
|
|
|
|
'<%= eslint.all %>',
|
|
|
|
|
'<%= stylelint.all %>'
|
2015-05-02 03:31:16 +00:00
|
|
|
|
],
|
|
|
|
|
tasks: 'test'
|
2015-06-12 04:32:18 +00:00
|
|
|
|
},
|
|
|
|
|
jsonlint: {
|
|
|
|
|
all: [
|
|
|
|
|
'**/*.json',
|
2016-05-16 20:59:43 +00:00
|
|
|
|
'!node_modules/**',
|
|
|
|
|
'!docs/**'
|
2015-06-12 04:32:18 +00:00
|
|
|
|
]
|
2015-05-02 03:31:16 +00:00
|
|
|
|
}
|
|
|
|
|
} );
|
|
|
|
|
|
2016-11-18 21:16:43 +00:00
|
|
|
|
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
|
2015-05-02 03:31:16 +00:00
|
|
|
|
grunt.registerTask( 'test', 'lint' );
|
|
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
|
};
|