aboutsummaryrefslogtreecommitdiffstats
path: root/build/tasks
diff options
context:
space:
mode:
authorTimmy Willison <timmywillisn@gmail.com>2014-07-17 10:25:59 -0700
committerTimmy Willison <timmywillisn@gmail.com>2014-07-17 10:25:59 -0700
commitc869a1ef8a031342e817a2c063179a787ff57239 (patch)
treebf70e1683cc53d5d3793a8deb0aaafe2bd684513 /build/tasks
parent8e3a0ceafa2c7c78902d0eab07d21b793deb5366 (diff)
downloadjquery-c869a1ef8a031342e817a2c063179a787ff57239.tar.gz
jquery-c869a1ef8a031342e817a2c063179a787ff57239.zip
Build: update grunt-jscs-checker and pass with the new rules
Diffstat (limited to 'build/tasks')
-rw-r--r--build/tasks/build.js36
1 files changed, 25 insertions, 11 deletions
diff --git a/build/tasks/build.js b/build/tasks/build.js
index 03aacf9eb..a64481fe6 100644
--- a/build/tasks/build.js
+++ b/build/tasks/build.js
@@ -1,6 +1,7 @@
/**
* Special concat/build task to handle various jQuery build requirements
- * Concats AMD modules, removes their definitions, and includes/excludes specified modules
+ * Concats AMD modules, removes their definitions,
+ * and includes/excludes specified modules
*/
module.exports = function( grunt ) {
@@ -35,7 +36,8 @@ module.exports = function( grunt ) {
/**
* Strip all definitions generated by requirejs
* Convert "var" modules to var declarations
- * "var module" means the module only contains a return statement that should be converted to a var declaration
+ * "var module" means the module only contains a return
+ * statement that should be converted to a var declaration
* This is indicated by including the file in any "var" folder
* @param {String} name
* @param {String} path
@@ -98,7 +100,8 @@ module.exports = function( grunt ) {
grunt.registerMultiTask(
"build",
- "Concatenate source, remove sub AMD definitions, (include/exclude modules with +/- flags), embed date/version",
+ "Concatenate source, remove sub AMD definitions, " +
+ "(include/exclude modules with +/- flags), embed date/version",
function() {
var flag, index,
done = this.async(),
@@ -113,7 +116,8 @@ module.exports = function( grunt ) {
/**
* Recursively calls the excluder to remove on all modules in the list
* @param {Array} list
- * @param {String} [prepend] Prepend this to the module name. Indicates we're walking a directory
+ * @param {String} [prepend] Prepend this to the module name.
+ * Indicates we're walking a directory
*/
excludeList = function( list, prepend ) {
if ( list ) {
@@ -121,7 +125,9 @@ module.exports = function( grunt ) {
list.forEach(function( module ) {
// Exclude var modules as well
if ( module === "var" ) {
- excludeList( fs.readdirSync( srcFolder + prepend + module ), prepend + module );
+ excludeList(
+ fs.readdirSync( srcFolder + prepend + module ), prepend + module
+ );
return;
}
if ( prepend ) {
@@ -143,7 +149,9 @@ module.exports = function( grunt ) {
},
/**
* Adds the specified module to the excluded or included list, depending on the flag
- * @param {String} flag A module path relative to the src directory starting with + or - to indicate whether it should included or excluded
+ * @param {String} flag A module path relative to
+ * the src directory starting with + or - to indicate
+ * whether it should included or excluded
*/
excluder = function( flag ) {
var m = /^(\+|\-|)([\w\/-]+)$/.exec( flag ),
@@ -162,7 +170,7 @@ module.exports = function( grunt ) {
// It's fine if the directory is not there
try {
excludeList( fs.readdirSync( srcFolder + module ), module );
- } catch( e ) {
+ } catch ( e ) {
grunt.verbose.writeln( e );
}
}
@@ -171,7 +179,9 @@ module.exports = function( grunt ) {
} else {
grunt.log.error( "Module \"" + module + "\" is a mimimum requirement.");
if ( module === "selector" ) {
- grunt.log.error( "If you meant to replace Sizzle, use -sizzle instead." );
+ grunt.log.error(
+ "If you meant to replace Sizzle, use -sizzle instead."
+ );
}
}
} else {
@@ -195,8 +205,10 @@ module.exports = function( grunt ) {
// * none (implicit exclude)
// *:* all (implicit include)
// *:*:-css all except css and dependents (explicit > implicit)
- // *:*:-css:+effects same (excludes effects because explicit include is trumped by explicit exclude of dependency)
- // *:+effects none except effects and its dependencies (explicit include trumps implicit exclude of dependency)
+ // *:*:-css:+effects same (excludes effects because explicit include is
+ // trumped by explicit exclude of dependency)
+ // *:+effects none except effects and its dependencies
+ // (explicit include trumps implicit exclude of dependency)
delete flags[ "*" ];
for ( flag in flags ) {
excluder( flag );
@@ -249,7 +261,9 @@ module.exports = function( grunt ) {
// Turn off opt-in if necessary
if ( !optIn ) {
// Overwrite the default inclusions with the explicit ones provided
- config.rawText.jquery = "define([" + (included.length ? included.join(",") : "") + "]);";
+ config.rawText.jquery = "define([" +
+ (included.length ? included.join(",") : "") +
+ "]);";
}
// Trace dependencies and concatenate files