8
0

jshint.js 652 B

123456789101112131415161718192021222324252627282930313233
  1. /* jshint node: true */
  2. 'use strict';
  3. var tools = require( './res/tools' );
  4. module.exports = function( grunt ) {
  5. tools.setupMultitaskConfig( grunt, {
  6. task: 'jshint',
  7. defaultOptions: grunt.file.readJSON( 'dev/tasks/jshint-config.json' ),
  8. targets: {
  9. all: function() {
  10. return [ '**/*.js' ];
  11. },
  12. git: function() {
  13. return tools.getGitDirtyFiles().filter( function( file ) {
  14. return ( /\.js$/ ).test( file );
  15. } );
  16. }
  17. }
  18. } );
  19. // Take ignore list from .gitIgnore.
  20. grunt.config.merge( {
  21. jshint: {
  22. options: {
  23. ignores: tools.getGitIgnore( grunt )
  24. }
  25. }
  26. } );
  27. grunt.loadNpmTasks( 'grunt-contrib-jshint' );
  28. };