jshint.js 600 B

12345678910111213141516171819202122232425262728293031
  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: defaultConfig
  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. };
  21. var defaultConfig = {
  22. 'globalstrict': true,
  23. 'validthis': true
  24. };