8
0

jshint.js 579 B

12345678910111213141516171819202122232425262728293031
  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();
  14. }
  15. }
  16. } );
  17. // Take ignore list from .gitIgnore.
  18. grunt.config.merge( {
  19. jshint: {
  20. options: {
  21. ignores: tools.getGitIgnore( grunt )
  22. }
  23. }
  24. } );
  25. grunt.loadNpmTasks( 'grunt-contrib-jshint' );
  26. };