| 126 | }, |
| 127 | // Process only one file passed from cli |
| 128 | // Run with grunt jslint:core --target=filename.js |
| 129 | filter: function( filepath ) { |
| 130 | var target = grunt.option('target'); |
| 131 | |
| 132 | // Don't filter when no target file specified |
| 133 | if ( ! target ) { |
| 134 | return true; |
| 135 | } |
| 136 | |
| 137 | // Normalize filepath for Win |
| 138 | filepath = filepath.replace(/\\/g, '/'); |
| 139 | |
| 140 | // Match only the filename passed from cli |
| 141 | if ( filepath.lastIndexOf( '/' + target ) == filepath.length - ( target.length + 1 ) ) { |
| 142 | return true; |
| 143 | } |
| 144 | |
| 145 | return false; |