8
0

jshint.js 572 B

1234567891011121314151617181920212223242526
  1. /* jshint node: true */
  2. 'use strict';
  3. var tools = require( './res/tools' );
  4. module.exports = function( grunt ) {
  5. // Point to the default configurations.
  6. var config = {
  7. options: grunt.file.readJSON( 'dev/tasks/jshint-config.json' )
  8. };
  9. // Create the appropriate task target.
  10. if ( tools.checkTaskInQueue( grunt, 'jshint:git' ) ) {
  11. config.git = tools.getGitDirtyFiles();
  12. } else {
  13. config.all = [ '**/*.js' ];
  14. }
  15. // Merge over configurations set in gruntfile.js.
  16. grunt.config.merge( {
  17. jshint: config
  18. } );
  19. grunt.loadNpmTasks( 'grunt-contrib-jshint' );
  20. };