2

I tried to let grunt jshint scans all the js file except the files in the node_modules folder. I tried the follow configuration of grunt, it still scan all the files including the ones in node_modules. anyone know why? also can anyone explain /**/*.js **/*.js. what is the double star mean. here is my grunt config files

module.exports = function(grunt) {

    grunt.initConfig({
        jshint: {
            all: ['**/*.js'],
            options: {
                ignores: ['node_modules']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
};
eded
  • 3,778
  • 8
  • 28
  • 42
  • Checkout this answer: http://stackoverflow.com/questions/20695823/grunt-contrib-jshint-ignores-has-no-effect – ateich Dec 19 '14 at 00:24

1 Answers1

2

Base on @ateich hint, I realized I can do the following to fix the problem

module.exports = function(grunt) {
    grunt.initConfig({
        jshint: {
            all: ['**/*.js'],
            options: {
                jshintrc: true,
                ignores: ['node_modules/**/*.js']
            }
        }
    });

    grunt.loadNpmTasks('grunt-contrib-jshint');
};
Phil Hannent
  • 12,047
  • 17
  • 71
  • 118
eded
  • 3,778
  • 8
  • 28
  • 42