| 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 folder: |
| 283 | // |
| 284 | // grunt jshint:plugins --folder=foldername |
| 285 | // |
| 286 | // Optionally, include the folder path: |
| 287 | // |
| 288 | // grunt jshint:plugins --folder=foldername |
| 289 | // |
| 290 | filter: function( folderpath ) { |
| 291 | var index, folder = grunt.option( 'folder' ); |
| 292 | |
| 293 | // Don't filter when no target folder is specified |
| 294 | if ( ! folder ) { |
| 295 | return true; |
| 296 | } |
| 297 | |
| 298 | folderpath = folderpath.replace( /\\/g, '/' ); |
| 299 | index = folderpath.lastIndexOf( '/' + folder ); |
| 300 | |
| 301 | // Match only the folder name passed from cli |
| 302 | if ( -1 !== index ) { |
| 303 | return true; |
| 304 | } |
| 305 | |
| 306 | return false; |
| 307 | } |