2015-06-20 04:54:10 +00:00
|
|
|
/*jshint node:true */
|
|
|
|
module.exports = function ( grunt ) {
|
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2015-09-14 18:46:13 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-jscs' );
|
2016-05-19 17:06:34 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-stylelint' );
|
2015-06-20 04:54:10 +00:00
|
|
|
|
|
|
|
grunt.initConfig( {
|
|
|
|
banana: {
|
|
|
|
all: 'i18n/'
|
|
|
|
},
|
|
|
|
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
|
|
|
},
|
|
|
|
jshint: {
|
|
|
|
options: {
|
|
|
|
jshintrc: true
|
|
|
|
},
|
|
|
|
all: [
|
|
|
|
'*.js',
|
|
|
|
'modules/**/*.js'
|
|
|
|
]
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
files: [
|
2016-05-20 13:01:31 +00:00
|
|
|
'.{stylelintrc,jscsrc,jshintignore,jshintrc}',
|
2015-09-14 18:46:13 +00:00
|
|
|
'<%= jshint.all %>',
|
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'
|
|
|
|
},
|
|
|
|
jscs: {
|
|
|
|
fix: {
|
|
|
|
options: {
|
|
|
|
fix: true
|
|
|
|
},
|
|
|
|
src: '<%= jshint.all %>'
|
|
|
|
},
|
|
|
|
main: {
|
|
|
|
src: '<%= jshint.all %>'
|
|
|
|
}
|
2015-06-20 04:54:10 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2016-05-19 17:06:34 +00:00
|
|
|
grunt.registerTask( 'test', [ 'jshint', 'jscs:main', 'stylelint', 'jsonlint', 'banana' ] );
|
2015-06-20 04:54:10 +00:00
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|