2015-05-02 03:31:16 +00:00
|
|
|
/*jshint node:true */
|
|
|
|
module.exports = function ( grunt ) {
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
2015-06-12 04:32:18 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
2015-05-02 03:31:16 +00:00
|
|
|
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
|
|
|
grunt.loadNpmTasks( 'grunt-jscs' );
|
|
|
|
|
|
|
|
grunt.initConfig( {
|
|
|
|
jshint: {
|
|
|
|
options: {
|
2015-10-31 12:35:06 +00:00
|
|
|
jshintrc: true,
|
|
|
|
ignores: [
|
|
|
|
'tests/externals/**'
|
|
|
|
]
|
2015-05-02 03:31:16 +00:00
|
|
|
},
|
|
|
|
all: [
|
2015-10-31 12:35:06 +00:00
|
|
|
'**/*.js',
|
|
|
|
'!node_modules/**'
|
2015-05-02 03:31:16 +00:00
|
|
|
]
|
|
|
|
},
|
|
|
|
jscs: {
|
2015-10-31 12:35:06 +00:00
|
|
|
src: [
|
|
|
|
'<%= jshint.all %>',
|
|
|
|
'!tests/externals/**'
|
|
|
|
]
|
2015-05-02 03:31:16 +00:00
|
|
|
},
|
|
|
|
banana: {
|
|
|
|
all: 'i18n/'
|
|
|
|
},
|
|
|
|
watch: {
|
|
|
|
files: [
|
|
|
|
'.{csslintrc,jscsrc,jshintignore,jshintrc}',
|
|
|
|
'<%= jshint.all %>',
|
|
|
|
'<%= csslint.all %>'
|
|
|
|
],
|
|
|
|
tasks: 'test'
|
2015-06-12 04:32:18 +00:00
|
|
|
},
|
|
|
|
jsonlint: {
|
|
|
|
all: [
|
|
|
|
'**/*.json',
|
|
|
|
'!node_modules/**'
|
|
|
|
]
|
2015-05-02 03:31:16 +00:00
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
2016-01-17 21:12:11 +00:00
|
|
|
grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'jsonlint', 'banana' ] );
|
2015-05-02 03:31:16 +00:00
|
|
|
grunt.registerTask( 'test', 'lint' );
|
|
|
|
grunt.registerTask( 'default', 'test' );
|
|
|
|
};
|