Add a grunt jshint:plugins
task.
Props MattyRob. Fixes #28464. git-svn-id: https://develop.svn.wordpress.org/trunk@28798 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
5c48c4f8a8
commit
72a61e941d
30
Gruntfile.js
30
Gruntfile.js
@ -271,6 +271,36 @@ module.exports = function(grunt) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
},
|
||||
plugins: {
|
||||
expand: true,
|
||||
cwd: SOURCE_DIR + 'wp-content/plugins',
|
||||
src: [
|
||||
'**/*.js',
|
||||
'!**/*.min.js'
|
||||
],
|
||||
// Limit JSHint's run to a single specified plugin folder:
|
||||
//
|
||||
// grunt jshint:plugins --folder=foldername
|
||||
//
|
||||
filter: function( folderpath ) {
|
||||
var index, folder = grunt.option( 'folder' );
|
||||
|
||||
// Don't filter when no target folder is specified
|
||||
if ( ! folder ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
folderpath = folderpath.replace( /\\/g, '/' );
|
||||
index = folderpath.lastIndexOf( '/' + folder );
|
||||
|
||||
// Match only the folder name passed from cli
|
||||
if ( -1 !== index ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user