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',
|
|
|
|
'!node_modules/**'
|
|
|
|
]
|
2015-09-14 18:46:13 +00:00
|
|
|
},
|
2016-05-19 17:06:34 +00:00
|
|
|
stylelint: {
|
|
|
|
core: {
|
|
|
|
src: [
|
|
|
|
'**/*.css',
|
|
|
|
'!modules/ve-math/**',
|
|
|
|
'!node_modules/**'
|
|
|
|
]
|
2015-09-14 18:46:13 +00:00
|
|
|
},
|
2016-05-19 17:06:34 +00:00
|
|
|
've-math': {
|
|
|
|
options: {
|
|
|
|
configFile: 'modules/ve-math/.stylelintrc'
|
|
|
|
},
|
|
|
|
src: [
|
|
|
|
'modules/ve-math/**/*.css'
|
|
|
|
]
|
|
|
|
}
|
2015-09-14 18:46:13 +00:00
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
files: [
|
2016-10-28 18:11:26 +00:00
|
|
|
'.{stylelintrc,.eslintrc.json}',
|
|
|
|
'<%= eslint.main %>',
|
2016-05-20 13:01:31 +00:00
|
|
|
'<%= stylelint.core.src %>',
|
|
|
|
'<%= stylelint[ "ve-math" ].src %>'
|
2015-09-14 18:46:13 +00:00
|
|
|
],
|
|
|
|
tasks: 'test'
|
|
|
|
},
|
2016-10-28 18:11:26 +00:00
|
|
|
eslint: {
|
2015-09-14 18:46:13 +00:00
|
|
|
fix: {
|
|
|
|
options: {
|
|
|
|
fix: true
|
|
|
|
},
|
2016-10-28 18:11:26 +00:00
|
|
|
src: '<%= eslint.main %>'
|
2015-09-14 18:46:13 +00:00
|
|
|
},
|
2016-10-28 18:11:26 +00:00
|
|
|
main: [
|
|
|
|
'*.js',
|
|
|
|
'modules/**/*.js',
|
|
|
|
'!**/node_modules/**'
|
|
|
|
]
|
2015-06-20 04:54:10 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2016-10-28 18:11:26 +00:00
|
|
|
grunt.registerTask( 'test', [ 'eslint:main', 'stylelint', 'jsonlint', 'banana' ] );
|
|
|
|
grunt.registerTask( 'fix', 'eslint:fix' );
|
2015-06-20 04:54:10 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|