| 274 | }, |
| 275 | plugins: { |
| 276 | expand: true, |
| 277 | cwd: SOURCE_DIR + 'wp-content/plugins', |
| 278 | src: [ |
| 279 | '**/*.js', |
| 280 | '!**/*.min.js' |
| 281 | ], |
| 282 | // Limit JSHint's run to a single specified plugin folder: |
| 283 | // |
| 284 | // grunt jshint:plugins --folder=foldername |
| 285 | // |
| 286 | filter: function( folderpath ) { |
| 287 | var index, folder = grunt.option( 'folder' ); |
| 288 | |
| 289 | // Don't filter when no target folder is specified |
| 290 | if ( ! folder ) { |
| 291 | return true; |
| 292 | } |
| 293 | |
| 294 | folderpath = folderpath.replace( /\\/g, '/' ); |
| 295 | index = folderpath.lastIndexOf( '/' + folder ); |
| 296 | |
| 297 | // Match only the folder name passed from cli |
| 298 | if ( -1 !== index ) { |
| 299 | return true; |
| 300 | } |
| 301 | |
| 302 | return false; |
| 303 | } |