Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

grunt-contrib-jshint ignores has no effect

Tags:

gruntjs

jshint

I would like to exclude libs directory from being lint'ed. However, ignores in options and planted .jshintignore file in project directory won't make libs to be excluded.

 jshint: {
  options: {
    smarttabs: true,
    ignores: ['public/js/libs/**/*.js']
  },

  all: [
        'Gruntfile.js', 
        'public/js/**/*.js'
      ]

},

grunt version:

 grunt-cli v0.1.11
 grunt v0.4.2
 [email protected]

What did I miss out?

like image 324
Cheng Ping Onn Avatar asked Dec 20 '13 03:12

Cheng Ping Onn


1 Answers

ignores is a jshint option and expects specific files. It's better to use the idiomatic Grunt negate ! to exclude files:

jshint: {
  options: {
    smarttabs: true
  },
  all: [
    'Gruntfile.js', 
    'public/js/**/*.js',
    '!public/js/libs/**/*.js'
  ],
},

See http://gruntjs.com/configuring-tasks#globbing-patterns

like image 159
Kyle Robinson Young Avatar answered Nov 12 '22 03:11

Kyle Robinson Young