cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From audre...@apache.org
Subject [03/18] cordova-lib git commit: CB-12895 : ran eslint --fix on cordova-lib
Date Fri, 28 Jul 2017 18:26:34 GMT
http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/platforms/blackberry10.js
----------------------------------------------------------------------
diff --git a/src/plugman/platforms/blackberry10.js b/src/plugman/platforms/blackberry10.js
index c3d0310..55853da 100644
--- a/src/plugman/platforms/blackberry10.js
+++ b/src/plugman/platforms/blackberry10.js
@@ -17,79 +17,76 @@
     under the License.
 */
 
-/* jshint laxcomma:true, sub:true */
-
-var path = require('path')
-   , common = require('./common')
-   , events = require('cordova-common').events
-   , xml_helpers = require('cordova-common').xmlHelpers
-   ;
+var path = require('path');
+var common = require('./common');
+var events = require('cordova-common').events;
+var xml_helpers = require('cordova-common').xmlHelpers;
 
 var TARGETS = ['device', 'simulator'];
 
 module.exports = {
-    www_dir:function(project_dir) {
+    www_dir: function (project_dir) {
         return path.join(project_dir, 'www');
     },
-    package_name:function(project_dir) {
+    package_name: function (project_dir) {
         var config_path = path.join(module.exports.www_dir(project_dir), 'config.xml');
         var widget_doc = xml_helpers.parseElementtreeSync(config_path);
         return widget_doc._root.attrib['id'];
     },
-    'source-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'source-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             var src = obj.src;
             var target = obj.targetDir || plugin_id;
-            TARGETS.forEach(function(arch) {
+            TARGETS.forEach(function (arch) {
                 var dest = path.join('native', arch, 'chrome', 'plugin', target, path.basename(src));
 
                 common.copyNewFile(plugin_dir, src, project_dir, dest);
             });
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             var src = obj.src;
             var target = obj.targetDir || plugin_id;
-            TARGETS.forEach(function(arch) {
+            TARGETS.forEach(function (arch) {
                 var dest = path.join('native', arch, 'chrome', 'plugin', target, path.basename(src));
                 common.removeFile(project_dir, dest);
             });
         }
     },
     'header-file': {
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'header-file.install is not supported for blackberry');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'header-file.uninstall is not supported for blackberry');
         }
     },
-    'lib-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'lib-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             var src = obj.src;
             var arch = obj.arch;
             var dest = path.join('native', arch, 'plugins', 'jnext', path.basename(src));
             common.copyFile(plugin_dir, src, project_dir, dest, false);
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             var src = obj.src;
             var arch = obj.arch;
             var dest = path.join('native', arch, 'plugins', 'jnext', path.basename(src));
             common.removeFile(project_dir, dest);
         }
     },
-    'resource-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'resource-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'resource-file.install is not supported for blackberry');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'resource-file.uninstall is not supported for blackberry');
         }
     },
     'framework': {
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'framework.install is not supported for blackberry');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'framework.uninstall is not supported for blackberry');
         }
     }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/platforms/browser.js
----------------------------------------------------------------------
diff --git a/src/plugman/platforms/browser.js b/src/plugman/platforms/browser.js
index 3aaa961..5006127 100644
--- a/src/plugman/platforms/browser.js
+++ b/src/plugman/platforms/browser.js
@@ -17,59 +17,56 @@
     under the License.
 */
 
-/* jshint laxcomma:true, sub:true */
-
-var path = require('path')
-    , common = require('./common')
-    , events = require('cordova-common').events
-    ;
+var path = require('path');
+var common = require('./common');
+var events = require('cordova-common').events;
 
 module.exports = {
-    www_dir: function(project_dir) {
+    www_dir: function (project_dir) {
         return path.join(project_dir, 'www');
     },
-    package_name:function(project_dir) {
+    package_name: function (project_dir) {
         return common.package_name(project_dir, this.www_dir(project_dir));
     },
-    'source-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'source-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             var dest = path.join(obj.targetDir, path.basename(obj.src));
             common.copyFile(plugin_dir, obj.src, project_dir, dest);
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             var dest = path.join(obj.targetDir, path.basename(obj.src));
             common.removeFile(project_dir, dest);
         }
     },
     'header-file': {
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'header-fileinstall is not supported for browser');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'header-file.uninstall is not supported for browser');
         }
     },
-    'resource-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'resource-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'resource-file.install is not supported for browser');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'resource-file.uninstall is not supported for browser');
         }
     },
     'framework': {
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'framework.install is not supported for browser');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'framework.uninstall is not supported for browser');
         }
     },
     'lib-file': {
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'lib-file.install is not supported for browser');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'lib-file.uninstall is not supported for browser');
         }
     }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/platforms/common.js
----------------------------------------------------------------------
diff --git a/src/plugman/platforms/common.js b/src/plugman/platforms/common.js
index 29d5df6..4e03b6b 100644
--- a/src/plugman/platforms/common.js
+++ b/src/plugman/platforms/common.js
@@ -17,23 +17,23 @@
     under the License.
 */
 
-var shell = require('shelljs'),
-    path  = require('path'),
-    fs    = require('fs'),
-    common;
+var shell = require('shelljs');
+var path = require('path');
+var fs = require('fs');
+var common;
 
 var cordovaUtil = require('../../cordova/util');
 var CordovaError = require('cordova-common').CordovaError;
 var xmlHelpers = require('cordova-common').xmlHelpers;
 
 module.exports = common = {
-    package_name: function(project_dir, www_dir) {
+    package_name: function (project_dir, www_dir) {
 
         var configPaths = [
             // preferred location if cordova >= 3.4
             path.join(project_dir, 'config.xml'),
             // older location
-            path.join(www_dir || path.join(project_dir, 'www'), 'config.xml'),
+            path.join(www_dir || path.join(project_dir, 'www'), 'config.xml')
         ];
 
         var cordovaRoot = cordovaUtil.isCordova();
@@ -56,30 +56,28 @@ module.exports = common = {
             'the following directories:\n\t' + configPaths.join('\n\t'));
     },
     // helper for resolving source paths from plugin.xml
-    resolveSrcPath:function(plugin_dir, relative_path) {
+    resolveSrcPath: function (plugin_dir, relative_path) {
         var full_path = path.resolve(plugin_dir, relative_path);
         return full_path;
     },
     // helper for resolving target paths from plugin.xml into a cordova project
-    resolveTargetPath:function(project_dir, relative_path) {
+    resolveTargetPath: function (project_dir, relative_path) {
         var full_path = path.resolve(project_dir, relative_path);
         return full_path;
     },
-    copyFile:function(plugin_dir, src, project_dir, dest, link) {
+    copyFile: function (plugin_dir, src, project_dir, dest, link) {
         src = module.exports.resolveSrcPath(plugin_dir, src);
         if (!fs.existsSync(src)) throw new Error('"' + src + '" not found!');
 
         // check that src path is inside plugin directory
         var real_path = fs.realpathSync(src);
         var real_plugin_path = fs.realpathSync(plugin_dir);
-        if (real_path.indexOf(real_plugin_path) !== 0)
-            throw new Error('"' + src + '" not located within plugin!');
+        if (real_path.indexOf(real_plugin_path) !== 0) { throw new Error('"' + src + '" not located within plugin!'); }
 
         dest = module.exports.resolveTargetPath(project_dir, dest);
 
         // check that dest path is located in project directory
-        if (dest.indexOf(project_dir) !== 0)
-            throw new Error('"' + dest + '" not located within project!');
+        if (dest.indexOf(project_dir) !== 0) { throw new Error('"' + dest + '" not located within project!'); }
 
         shell.mkdir('-p', path.dirname(dest));
 
@@ -87,48 +85,46 @@ module.exports = common = {
             common.symlinkFileOrDirTree(src, dest);
         } else if (fs.statSync(src).isDirectory()) {
             // XXX shelljs decides to create a directory when -R|-r is used which sucks. http://goo.gl/nbsjq
-            shell.cp('-Rf', src+'/*', dest);
+            shell.cp('-Rf', src + '/*', dest);
         } else {
             shell.cp('-f', src, dest);
         }
     },
     // Same as copy file but throws error if target exists
-    copyNewFile:function(plugin_dir, src, project_dir, dest, link) {
+    copyNewFile: function (plugin_dir, src, project_dir, dest, link) {
         var target_path = common.resolveTargetPath(project_dir, dest);
-        if (fs.existsSync(target_path))
-            throw new Error('"' + target_path + '" already exists!');
+        if (fs.existsSync(target_path)) { throw new Error('"' + target_path + '" already exists!'); }
 
         common.copyFile(plugin_dir, src, project_dir, dest, !!link);
     },
-    symlinkFileOrDirTree:function symlinkFileOrDirTree(src, dest) {
-            if (fs.existsSync(dest)) {
-                shell.rm('-Rf', dest);
-            }
-            
-            if (fs.statSync(src).isDirectory()) {
-                shell.mkdir('-p', dest);
-                fs.readdirSync(src).forEach(function(entry) {
-                    symlinkFileOrDirTree(path.join(src, entry), path.join(dest, entry));
-                });
-            }
-            else {
-                fs.symlinkSync(path.relative(fs.realpathSync(path.dirname(dest)), src), dest);
-            }
+    symlinkFileOrDirTree: function symlinkFileOrDirTree (src, dest) {
+        if (fs.existsSync(dest)) {
+            shell.rm('-Rf', dest);
+        }
+
+        if (fs.statSync(src).isDirectory()) {
+            shell.mkdir('-p', dest);
+            fs.readdirSync(src).forEach(function (entry) {
+                symlinkFileOrDirTree(path.join(src, entry), path.join(dest, entry));
+            });
+        } else {
+            fs.symlinkSync(path.relative(fs.realpathSync(path.dirname(dest)), src), dest);
+        }
     },
     // checks if file exists and then deletes. Error if doesn't exist
-    removeFile:function(project_dir, src) {
+    removeFile: function (project_dir, src) {
         var file = module.exports.resolveSrcPath(project_dir, src);
         shell.rm('-Rf', file);
     },
     // deletes file/directory without checking
-    removeFileF:function(file) {
+    removeFileF: function (file) {
         shell.rm('-Rf', file);
     },
     // Sometimes we want to remove some java, and prune any unnecessary empty directories
-    deleteJava:function(project_dir, destFile) {
+    deleteJava: function (project_dir, destFile) {
         common.removeFileAndParents(project_dir, destFile, 'src');
     },
-    removeFileAndParents:function(baseDir, destFile, stopper) {
+    removeFileAndParents: function (baseDir, destFile, stopper) {
         stopper = stopper || '.';
         var file = path.resolve(baseDir, destFile);
         if (!fs.existsSync(file)) return;
@@ -138,8 +134,8 @@ module.exports = common = {
         // check if directory is empty
         var curDir = path.dirname(file);
 
-        while(curDir !== path.resolve(baseDir, stopper)) {
-            if(fs.existsSync(curDir) && fs.readdirSync(curDir).length === 0) {
+        while (curDir !== path.resolve(baseDir, stopper)) {
+            if (fs.existsSync(curDir) && fs.readdirSync(curDir).length === 0) {
                 fs.rmdirSync(curDir);
                 curDir = path.resolve(curDir, '..');
             } else {
@@ -149,8 +145,8 @@ module.exports = common = {
         }
     },
     // handle <asset> elements
-    asset:{
-        install:function(asset, plugin_dir, www_dir) {
+    asset: {
+        install: function (asset, plugin_dir, www_dir) {
             if (!asset.src) {
                 throw new Error('<asset> tag without required "src" attribute. plugin=' + plugin_dir);
             }
@@ -160,7 +156,7 @@ module.exports = common = {
 
             common.copyFile(plugin_dir, asset.src, www_dir, asset.target);
         },
-        uninstall:function(asset, www_dir, plugin_id) {
+        uninstall: function (asset, www_dir, plugin_id) {
             var target = asset.target || asset.src;
 
             if (!target) {
@@ -177,7 +173,7 @@ module.exports = common = {
             var moduleSource = path.resolve(plugin_dir, jsModule.src);
             // Get module name based on existing 'name' attribute or filename
             // Must use path.extname/path.basename instead of path.parse due to CB-9981
-            var moduleName = plugin_id + '.' + (jsModule.name || path.basename(jsModule.src, path.extname (jsModule.src)));
+            var moduleName = plugin_id + '.' + (jsModule.name || path.basename(jsModule.src, path.extname(jsModule.src)));
 
             // Read in the file, prepend the cordova.define, and write it back out.
             var scriptContent = fs.readFileSync(moduleSource, 'utf-8').replace(/^\ufeff/, ''); // Window BOM

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/platforms/tizen.js
----------------------------------------------------------------------
diff --git a/src/plugman/platforms/tizen.js b/src/plugman/platforms/tizen.js
index 7b7cc0f..42103f4 100644
--- a/src/plugman/platforms/tizen.js
+++ b/src/plugman/platforms/tizen.js
@@ -17,18 +17,16 @@
     under the License.
 */
 
-/* jshint laxcomma:true, sub:true */
-
-var path = require('path')
-    , fs = require('fs')
-    , events = require('cordova-common').events
-    , xml_helpers = require('cordova-common').xmlHelpers;
+var path = require('path');
+var fs = require('fs');
+var events = require('cordova-common').events;
+var xml_helpers = require('cordova-common').xmlHelpers;
 
 module.exports = {
-    www_dir: function(project_dir) {
+    www_dir: function (project_dir) {
         return path.join(project_dir, 'www');
     },
-    package_name:function(project_dir) {
+    package_name: function (project_dir) {
         // preferred location if cordova >= 3.4
         var preferred_path = path.join(project_dir, 'config.xml');
         var config_path;
@@ -38,7 +36,7 @@ module.exports = {
             if (!fs.existsSync(old_config_path)) {
                 // output newer location and fail reading
                 config_path = preferred_path;
-                events.emit('verbose', 'unable to find '+config_path);
+                events.emit('verbose', 'unable to find ' + config_path);
             } else {
                 config_path = old_config_path;
             }
@@ -48,24 +46,24 @@ module.exports = {
         var widget_doc = xml_helpers.parseElementtreeSync(config_path);
         return widget_doc._root.attrib['id'];
     },
-    'source-file':{
-        install: function(obj, plugin_dir, project_dir, plugin_id, options) {},
-        uninstall: function(obj, project_dir, plugin_id, options) {}
+    'source-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {},
+        uninstall: function (obj, project_dir, plugin_id, options) {}
     },
     'header-file': {
-        install: function(obj, plugin_dir, project_dir, plugin_id, options) {},
-        uninstall: function(obj, project_dir, plugin_id, options) {}
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {},
+        uninstall: function (obj, project_dir, plugin_id, options) {}
     },
-    'resource-file':{
-        install: function(obj, plugin_dir, project_dir, plugin_id, options) {},
-        uninstall: function(obj, project_dir, plugin_id, options) {}
+    'resource-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {},
+        uninstall: function (obj, project_dir, plugin_id, options) {}
     },
     'framework': {
-        install: function(obj, plugin_dir, project_dir, plugin_id, options) {},
-        uninstall: function(obj, project_dir, plugin_id, options) {}
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {},
+        uninstall: function (obj, project_dir, plugin_id, options) {}
     },
     'lib-file': {
-        install: function(obj, plugin_dir, project_dir, plugin_id, options) {},
-        uninstall: function(obj, project_dir, plugin_id, options) {}
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {},
+        uninstall: function (obj, project_dir, plugin_id, options) {}
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/platforms/ubuntu.js
----------------------------------------------------------------------
diff --git a/src/plugman/platforms/ubuntu.js b/src/plugman/platforms/ubuntu.js
index 6947330..6ab58a8 100644
--- a/src/plugman/platforms/ubuntu.js
+++ b/src/plugman/platforms/ubuntu.js
@@ -17,22 +17,20 @@
  *
 */
 
-/* jshint laxcomma:true, sub:true */
-
-function replaceAt(str, index, char) {
+function replaceAt (str, index, char) {
     return str.substr(0, index) + char + str.substr(index + char.length);
 }
 
-function toCamelCase(str) {
-    return str.split('-').map(function(str) {
+function toCamelCase (str) {
+    return str.split('-').map(function (str) {
         return replaceAt(str, 0, str[0].toUpperCase());
     }).join('');
 }
 
-function getPluginXml(plugin_dir) {
-    var et = require('elementtree'),
-    fs = require('fs'),
-    path = require('path');
+function getPluginXml (plugin_dir) {
+    var et = require('elementtree');
+    var fs = require('fs');
+    var path = require('path');
 
     var pluginxml;
     var config_path = path.join(plugin_dir, 'plugin.xml');
@@ -41,14 +39,13 @@ function getPluginXml(plugin_dir) {
         // Get the current plugin.xml file
         pluginxml = et.parse(fs.readFileSync(config_path, 'utf-8'));
     }
- 
+
     return pluginxml;
 }
 
-function findClassName(pluginxml, plugin_id) {
+function findClassName (pluginxml, plugin_id) {
     var class_name;
 
-    /* jshint ignore:start */
     // first check if we have a class-name parameter in the plugin config
     if (pluginxml) {
         var platform = pluginxml.find("./platform/[@name='ubuntu']/");
@@ -69,7 +66,7 @@ function findClassName(pluginxml, plugin_id) {
         class_name = plugin_id.match(/\.[^.]+$/)[0].substr(1);
     } else {
         // new-style (NPM registry)
-        var match = plugin_id.match(/cordova\-plugin\-([\w\-]+)$/);
+        var match = plugin_id.match(/cordova\-plugin\-([\w\-]+)$/); // eslint-disable-line no-useless-escape
         if (match && match.length > 0) {
             class_name = match[0].substr(15);
         } else {
@@ -84,32 +81,32 @@ function findClassName(pluginxml, plugin_id) {
     return toCamelCase(class_name);
 }
 
-var shell = require('shelljs')
-   , fs = require('fs')
-   , path = require('path')
-   , common = require('./common')
-   , events = require('cordova-common').events
-   , xml_helpers = require('cordova-common').xmlHelpers;
+var shell = require('shelljs');
+var fs = require('fs');
+var path = require('path');
+var common = require('./common');
+var events = require('cordova-common').events;
+var xml_helpers = require('cordova-common').xmlHelpers;
 
 module.exports = {
-    www_dir:function(project_dir) {
+    www_dir: function (project_dir) {
         return path.join(project_dir, 'www');
     },
 
-    package_name:function (project_dir) {
+    package_name: function (project_dir) {
         var config_path = path.join(project_dir, 'config.xml');
         var widget_doc = xml_helpers.parseElementtreeSync(config_path);
         return widget_doc._root.attrib['id'];
     },
-    'source-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'source-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             var dest = path.join('build', 'src', 'plugins', plugin_id, path.basename(obj.src));
             common.copyFile(plugin_dir, obj.src, project_dir, dest);
 
             var cmake = path.join(project_dir, 'build', 'CMakeLists.txt');
             shell.exec('touch ' + cmake);
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             var dest = path.join(project_dir, 'build', 'src', 'plugins', plugin_id);
             shell.rm(path.join(dest, path.basename(obj.src)));
 
@@ -117,63 +114,61 @@ module.exports = {
             shell.exec('touch ' + cmake);
         }
     },
-    'header-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'header-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             var dest = path.join('build', 'src', 'plugins', plugin_id, path.basename(obj.src));
             common.copyFile(plugin_dir, obj.src, project_dir, dest);
 
             var plugins = path.join(project_dir, 'build', 'src', 'coreplugins.cpp');
             var src = String(fs.readFileSync(plugins));
 
-            src = src.replace('INSERT_HEADER_HERE', '#include "plugins/' + plugin_id + '/' + path.basename(obj.src) +'"\nINSERT_HEADER_HERE');
+            src = src.replace('INSERT_HEADER_HERE', '#include "plugins/' + plugin_id + '/' + path.basename(obj.src) + '"\nINSERT_HEADER_HERE');
 
-            var pluginxml  = getPluginXml(plugin_dir);
+            var pluginxml = getPluginXml(plugin_dir);
             var class_name = findClassName(pluginxml, plugin_id);
             src = src.replace('INSERT_PLUGIN_HERE', 'INIT_PLUGIN(' + class_name + ');INSERT_PLUGIN_HERE');
 
             fs.writeFileSync(plugins, src);
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             var dest = path.join(project_dir, 'build', 'src', 'plugins', plugin_id);
             shell.rm(path.join(dest, path.basename(obj.src)));
 
             var plugins = path.join(project_dir, 'build', 'src', 'coreplugins.cpp');
             var src = String(fs.readFileSync(plugins));
 
-            src = src.replace('#include "plugins/' + plugin_id + '/' + path.basename(obj.src) +'"', '');
+            src = src.replace('#include "plugins/' + plugin_id + '/' + path.basename(obj.src) + '"', '');
             var class_name = findClassName(undefined, plugin_id);
             src = src.replace('INIT_PLUGIN(' + class_name + ');', '');
 
             fs.writeFileSync(plugins, src);
         }
     },
-    'resource-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'resource-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             var dest = path.join('qml', path.basename(obj.src));
-            if (obj.targetDir)
-                dest = path.join(obj.targetDir, path.basename(obj.src));
+            if (obj.targetDir) { dest = path.join(obj.targetDir, path.basename(obj.src)); }
             common.copyFile(plugin_dir, obj.src, project_dir, dest);
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             var dest = path.join(project_dir, 'qml');
-            if (obj.targetDir)
-                dest = path.join(project_dir, obj.targetDir);
+            if (obj.targetDir) { dest = path.join(project_dir, obj.targetDir); }
             shell.rm(path.join(dest, path.basename(obj.src)));
         }
     },
     'framework': {
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'framework.install is not supported for ubuntu');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'framework.uninstall is not supported for ubuntu');
         }
     },
     'lib-file': {
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             events.emit('verbose', 'lib-file.install is not supported for ubuntu');
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             events.emit('verbose', 'lib-file.uninstall is not supported for ubuntu');
         }
     }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/platforms/webos.js
----------------------------------------------------------------------
diff --git a/src/plugman/platforms/webos.js b/src/plugman/platforms/webos.js
index 183ea82..1221b64 100755
--- a/src/plugman/platforms/webos.js
+++ b/src/plugman/platforms/webos.js
@@ -17,62 +17,56 @@
     under the License.
 */
 
-/* jshint node:true, bitwise:true, undef:true, trailing:true, quotmark:true,
-          indent:4, unused:vars, latedef:nofunc,
-          laxcomma:true, sub:true
-*/
-
-var path = require('path')
-    , common = require('./common')
-    , events = require('cordova-common').events
-    ;
+var path = require('path');
+var common = require('./common');
+var events = require('cordova-common').events;
 
 module.exports = {
-    www_dir: function(project_dir) {
+    www_dir: function (project_dir) {
         return path.join(project_dir, 'www');
     },
-    package_name:function(project_dir) {
+    package_name: function (project_dir) {
         return common.package_name(project_dir, this.www_dir(project_dir));
     },
-    'source-file':{
-        install:function(obj, plugin_dir, project_dir, plugin_id, options) {
+    'source-file': {
+        install: function (obj, plugin_dir, project_dir, plugin_id, options) {
             var dest = path.join(obj.targetDir, path.basename(obj.src));
             common.copyFile(plugin_dir, obj.src, project_dir, dest);
         },
-        uninstall:function(obj, project_dir, plugin_id, options) {
+        uninstall: function (obj, project_dir, plugin_id, options) {
             var dest = path.join(obj.targetDir, path.basename(obj.src));
             common.removeFile(project_dir, dest);
         }
     },
     'header-file': {
-        install:function(source_el, plugin_dir, project_dir, plugin_id) {
+        install: function (source_el, plugin_dir, project_dir, plugin_id) {
             events.emit('verbose', 'header-fileinstall is not supported for webos');
         },
-        uninstall:function(source_el, project_dir, plugin_id) {
+        uninstall: function (source_el, project_dir, plugin_id) {
             events.emit('verbose', 'header-file.uninstall is not supported for webos');
         }
     },
-    'resource-file':{
-        install:function(el, plugin_dir, project_dir, plugin_id) {
+    'resource-file': {
+        install: function (el, plugin_dir, project_dir, plugin_id) {
             events.emit('verbose', 'resource-file.install is not supported for webos');
         },
-        uninstall:function(el, project_dir, plugin_id) {
+        uninstall: function (el, project_dir, plugin_id) {
             events.emit('verbose', 'resource-file.uninstall is not supported for webos');
         }
     },
     'framework': {
-        install:function(source_el, plugin_dir, project_dir, plugin_id) {
+        install: function (source_el, plugin_dir, project_dir, plugin_id) {
             events.emit('verbose', 'framework.install is not supported for webos');
         },
-        uninstall:function(source_el, project_dir, plugin_id) {
+        uninstall: function (source_el, project_dir, plugin_id) {
             events.emit('verbose', 'framework.uninstall is not supported for webos');
         }
     },
     'lib-file': {
-        install:function(source_el, plugin_dir, project_dir, plugin_id) {
+        install: function (source_el, plugin_dir, project_dir, plugin_id) {
             events.emit('verbose', 'lib-file.install is not supported for webos');
         },
-        uninstall:function(source_el, project_dir, plugin_id) {
+        uninstall: function (source_el, project_dir, plugin_id) {
             events.emit('verbose', 'lib-file.uninstall is not supported for webos');
         }
     }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/plugman.js
----------------------------------------------------------------------
diff --git a/src/plugman/plugman.js b/src/plugman/plugman.js
index f7c6bb6..e87ce93 100644
--- a/src/plugman/plugman.js
+++ b/src/plugman/plugman.js
@@ -24,10 +24,10 @@ var aliasMethodToRawWithDeprecationNotice = require('../util/alias');
 var Q = require('q');
 
 var plugman = {
-    on:                 events.on.bind(events),
-    off:                events.removeListener.bind(events),
+    on: events.on.bind(events),
+    off: events.removeListener.bind(events),
     removeAllListeners: events.removeAllListeners.bind(events),
-    emit:               events.emit.bind(events),
+    emit: events.emit.bind(events),
     install: require('./install'),
     uninstall: require('./uninstall'),
     fetch: require('./fetch'),
@@ -50,25 +50,25 @@ var modulesToAlias = ['install', 'uninstall', 'fetch', 'browserify', 'help',
     'config', 'owner', 'search', 'info', 'create', 'platform',
     'createpackagejson'];
 
-modulesToAlias.forEach(function(mod) {
+modulesToAlias.forEach(function (mod) {
     aliasMethodToRawWithDeprecationNotice(mod, plugman, 'plugman');
 });
 
-plugman.commands =  {
-    'config'   : function(cli_opts) {
-        plugman.config(cli_opts.argv.remain, function(err) {
+plugman.commands = {
+    'config': function (cli_opts) {
+        plugman.config(cli_opts.argv.remain, function (err) {
             if (err) throw err;
             else console.log('done');
         });
     },
-    'owner'   : function(cli_opts) {
+    'owner': function (cli_opts) {
         plugman.owner(cli_opts.argv.remain);
     },
-    'install'  : function(cli_opts) {
-        if(!cli_opts.platform || !cli_opts.project || !cli_opts.plugin) {
+    'install': function (cli_opts) {
+        if (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin) {
             return console.log(plugman.help());
         }
-        if(cli_opts.browserify === true) {
+        if (cli_opts.browserify === true) {
             plugman.prepare = require('./prepare-browserify');
         }
         var cli_variables = {};
@@ -100,12 +100,12 @@ plugman.commands =  {
 
         return p;
     },
-    'uninstall': function(cli_opts) {
-        if(!cli_opts.platform || !cli_opts.project || !cli_opts.plugin) {
+    'uninstall': function (cli_opts) {
+        if (!cli_opts.platform || !cli_opts.project || !cli_opts.plugin) {
             return console.log(plugman.help());
         }
 
-        if(cli_opts.browserify === true) {
+        if (cli_opts.browserify === true) {
             plugman.prepare = require('./prepare-browserify');
         }
 
@@ -124,43 +124,43 @@ plugman.commands =  {
 
         return p;
     },
-    'search'   : function(cli_opts) {
-        plugman.search(cli_opts.argv.remain, function(err, plugins) {
+    'search': function (cli_opts) {
+        plugman.search(cli_opts.argv.remain, function (err, plugins) {
             if (err) throw err;
             else {
-                for(var plugin in plugins) {
+                for (var plugin in plugins) {
                     console.log(plugins[plugin].name, '-', plugins[plugin].description || 'no description provided');
                 }
             }
         });
     },
-    'info'     : function(cli_opts) {
-        plugman.info(cli_opts.argv.remain, function(err, plugin_info) {
+    'info': function (cli_opts) {
+        plugman.info(cli_opts.argv.remain, function (err, plugin_info) {
             if (err) throw err;
             else {
                 console.log('name:', plugin_info.name);
                 console.log('version:', plugin_info.version);
                 if (plugin_info.engines) {
-                    for(var i = 0, j = plugin_info.engines.length ; i < j ; i++) {
+                    for (var i = 0, j = plugin_info.engines.length; i < j; i++) {
                         console.log(plugin_info.engines[i].name, 'version:', plugin_info.engines[i].version);
                     }
                 }
             }
         });
     },
-    'publish'  : function() {
+    'publish': function () {
         events.emit('error', 'The publish functionality is not supported anymore since the Cordova Plugin registry\n' +
             'is moving to read-only state. For publishing use corresponding \'npm\' commands.\n\n' +
             'If for any reason you still need for \'plugman publish\' - consider downgrade to plugman@0.23.3');
     },
-    'unpublish': function(cli_opts) {
+    'unpublish': function (cli_opts) {
         events.emit('error', 'The publish functionality is not supported anymore since the Cordova Plugin registry\n' +
             'is moving to read-only state. For publishing/unpublishing use corresponding \'npm\' commands.\n\n' +
             'If for any reason you still need for \'plugman unpublish\' - consider downgrade to plugman@0.23.3');
     },
-    'create': function(cli_opts) {
-        if( !cli_opts.name || !cli_opts.plugin_id || !cli_opts.plugin_version) {
-            return console.log( plugman.help() );
+    'create': function (cli_opts) {
+        if (!cli_opts.name || !cli_opts.plugin_id || !cli_opts.plugin_version) {
+            return console.log(plugman.help());
         }
         var cli_variables = {};
         if (cli_opts.variable) {
@@ -170,22 +170,22 @@ plugman.commands =  {
                 if (/^[\w-_]+$/.test(key)) cli_variables[key] = tokens.join('=');
             });
         }
-        plugman.create( cli_opts.name, cli_opts.plugin_id, cli_opts.plugin_version, cli_opts.path || '.', cli_variables );
+        plugman.create(cli_opts.name, cli_opts.plugin_id, cli_opts.plugin_version, cli_opts.path || '.', cli_variables);
     },
-    'platform': function(cli_opts) {
+    'platform': function (cli_opts) {
         var operation = cli_opts.argv.remain[ 0 ] || '';
-        if( ( operation !== 'add' && operation !== 'remove' ) ||  !cli_opts.platform_name ) {
-            return console.log( plugman.help() );
+        if ((operation !== 'add' && operation !== 'remove') || !cli_opts.platform_name) {
+            return console.log(plugman.help());
         }
-        plugman.platform( { operation: operation, platform_name: cli_opts.platform_name } );
+        plugman.platform({ operation: operation, platform_name: cli_opts.platform_name });
     },
-    'createpackagejson'  : function(cli_opts) {
+    'createpackagejson': function (cli_opts) {
         var plugin_path = cli_opts.argv.remain[0];
-        if(!plugin_path) {
+        if (!plugin_path) {
             return console.log(plugman.help());
         }
         plugman.createpackagejson(plugin_path);
-    },
+    }
 };
 
 module.exports = plugman;

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/registry/manifest.js
----------------------------------------------------------------------
diff --git a/src/plugman/registry/manifest.js b/src/plugman/registry/manifest.js
index 071a66a..a57e204 100644
--- a/src/plugman/registry/manifest.js
+++ b/src/plugman/registry/manifest.js
@@ -17,14 +17,14 @@
     under the License.
 */
 
-var path = require('path'),
-    Q = require('q'),
-    fs = require('fs'),
-    whitelist = require('./whitelist');
+var path = require('path');
+var Q = require('q');
+var fs = require('fs');
+var whitelist = require('./whitelist');
 
 var PluginInfo = require('cordova-common').PluginInfo;
 
-function validateName(name) {
+function validateName (name) {
     if (!name.match(/^(\S+\.){2,}.*$/)) {
         throw new Error('Invalid plugin ID. It has to follow the reverse domain `com.domain.plugin` format');
     }
@@ -37,61 +37,61 @@ function validateName(name) {
 }
 
 // Returns a promise.
-function generatePackageJsonFromPluginXml(plugin_path) {
-    return Q().then(function() {
+function generatePackageJsonFromPluginXml (plugin_path) {
+    return Q().then(function () {
         var package_json = {};
         var pluginInfo = new PluginInfo(plugin_path);
 
         // REQUIRED: name, version
         // OPTIONAL: description, license, keywords, engine
-        var name = pluginInfo.id,
-            version = pluginInfo.version,
-            cordova_name = pluginInfo.name,
-            description = pluginInfo.description,
-            license = pluginInfo.license,
-            keywords = pluginInfo.keywords,
-            repo = pluginInfo.repo,
-            issue = pluginInfo.issue,
-            engines = pluginInfo.getEngines(),
-            platforms = pluginInfo.getPlatforms(),
-            englishdoc = '';
-
-        if(!version) throw new Error('`version` required');
+        var name = pluginInfo.id;
+        var version = pluginInfo.version;
+        var cordova_name = pluginInfo.name;
+        var description = pluginInfo.description;
+        var license = pluginInfo.license;
+        var keywords = pluginInfo.keywords;
+        var repo = pluginInfo.repo;
+        var issue = pluginInfo.issue;
+        var engines = pluginInfo.getEngines();
+        var platforms = pluginInfo.getPlatforms();
+        var englishdoc = '';
+
+        if (!version) throw new Error('`version` required');
 
         package_json.version = version;
 
-        if(!name) throw new Error('`id` is required');
+        if (!name) throw new Error('`id` is required');
 
         validateName(name);
 
         package_json.name = name.toLowerCase();
 
-        if(cordova_name) package_json.cordova_name = cordova_name;
-        if(description)  package_json.description  = description;
-        if(license)      package_json.license      = license;
-        if(repo)         package_json.repo         = repo;
-        if(issue)        package_json.issue        = issue;
-        if(keywords)     package_json.keywords     = keywords;
-        if(platforms) {
-            package_json.platforms = platforms.map(function(p) {
+        if (cordova_name) package_json.cordova_name = cordova_name;
+        if (description) package_json.description = description;
+        if (license) package_json.license = license;
+        if (repo) package_json.repo = repo;
+        if (issue) package_json.issue = issue;
+        if (keywords) package_json.keywords = keywords;
+        if (platforms) {
+            package_json.platforms = platforms.map(function (p) {
                 return p.name;
             });
         }
 
         // Adding engines
-        if(engines) {
-            package_json.engines = engines.map(function(e) {
+        if (engines) {
+            package_json.engines = engines.map(function (e) {
                 return {name: e.name, version: e.version};
             });
         }
 
         // Set docs_path to doc/index.md exists
         var docs_path = path.resolve(plugin_path, 'doc/index.md');
-        if(!(fs.existsSync(docs_path))){
+        if (!(fs.existsSync(docs_path))) {
             // Set docs_path to doc/en/index.md
             docs_path = path.resolve(plugin_path, 'doc/en/index.md');
         }
-        if(fs.existsSync(docs_path)){
+        if (fs.existsSync(docs_path)) {
             englishdoc = fs.readFileSync(docs_path, 'utf-8');
             package_json.englishdoc = englishdoc;
         }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/registry/registry.js
----------------------------------------------------------------------
diff --git a/src/plugman/registry/registry.js b/src/plugman/registry/registry.js
index 5123e73..723c054 100644
--- a/src/plugman/registry/registry.js
+++ b/src/plugman/registry/registry.js
@@ -17,13 +17,11 @@
     under the License.
 */
 
-/* jshint laxcomma:true */
-
-var npm = require('npm'),
-    Q = require('q'),
-    npmhelper = require('../../util/npm-helper'),
-    events = require('cordova-common').events,
-    pluginSpec = require('../../cordova/plugin/plugin_spec_parser');
+var npm = require('npm');
+var Q = require('q');
+var npmhelper = require('../../util/npm-helper');
+var events = require('cordova-common').events;
+var pluginSpec = require('../../cordova/plugin/plugin_spec_parser');
 
 module.exports = {
     settings: null,
@@ -43,11 +41,12 @@ module.exports = {
      * @param {Array} args Command argument
      * @return {Promise.<void>} Promise for completion.
      */
-    owner: function(args) {
+    owner: function (args) {
         var command = args && args[0];
-        if (command && (command === 'add' || command === 'rm'))
+        if (command && (command === 'add' || command === 'rm')) {
             return Q.reject('Support for \'owner add/rm\' commands has been removed ' +
                 'due to transition of Cordova plugins registry to read-only state');
+        }
 
         return initThenLoadSettingsWithRestore(function () {
             return Q.ninvoke(npm.commands, 'owner', args);
@@ -59,7 +58,7 @@ module.exports = {
      * @param {Array} args Array of keywords
      * @return {Promise.<Object>} Promised search results.
      */
-    search: function(args) {
+    search: function (args) {
         return initThenLoadSettingsWithRestore(function () {
             return Q.ninvoke(npm.commands, 'search', args, true);
         });
@@ -70,13 +69,12 @@ module.exports = {
      * @param {Array} with one element - the plugin id or "id@version"
      * @return {Promise.<string>} Promised path to fetched package.
      */
-    fetch: function(plugin) {
+    fetch: function (plugin) {
         plugin = plugin.shift();
-        return Q.fcall(function() {
-            //fetch from npm
+        return Q.fcall(function () {
+            // fetch from npm
             return fetchPlugin(plugin);
-        })
-        .fail(function(error) {
+        }).fail(function (error) {
             return Q.reject(error);
         });
     },
@@ -86,20 +84,20 @@ module.exports = {
      * @param {String} name Plugin name
      * @return {Promise.<Object>} Promised package info.
      */
-    info: function(plugin) {
+    info: function (plugin) {
         plugin = plugin.shift();
         return npmhelper.loadWithSettingsThenRestore({
             'cache-min': 0,
             'cache-max': 0
-        }, function() {
-            return Q.ninvoke(npm.commands, 'view', [plugin], /* silent = */ true )
-            .then(function(info) {
-                // Plugin info should be accessed as info[version]. If a version
-                // specifier like >=x.y.z was used when calling npm view, info
-                // can contain several versions, but we take the first one here.
-                var version = Object.keys(info)[0];
-                return info[version];
-            });
+        }, function () {
+            return Q.ninvoke(npm.commands, 'view', [plugin], /* silent = */ true)
+                .then(function (info) {
+                    // Plugin info should be accessed as info[version]. If a version
+                    // specifier like >=x.y.z was used when calling npm view, info
+                    // can contain several versions, but we take the first one here.
+                    var version = Object.keys(info)[0];
+                    return info[version];
+                });
         });
     }
 };
@@ -109,7 +107,7 @@ module.exports = {
  * settings, executes the promises, then restores npm.config. Use this rather than passing settings to npm.load, since
  * that only works the first time you try to load npm.
  */
-function initThenLoadSettingsWithRestore(promises) {
+function initThenLoadSettingsWithRestore (promises) {
     return npmhelper.loadWithSettingsThenRestore({}, promises);
 }
 
@@ -117,7 +115,7 @@ function initThenLoadSettingsWithRestore(promises) {
 * @param {string} plugin - the plugin id or "id@version"
 * @return {Promise.<string>} Promised path to fetched package.
 */
-function fetchPlugin(plugin) {
+function fetchPlugin (plugin) {
     events.emit('log', 'Fetching plugin "' + plugin + '" via npm');
     var parsedSpec = pluginSpec.parse(plugin);
     var scope = parsedSpec.scope || '';

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/search.js
----------------------------------------------------------------------
diff --git a/src/plugman/search.js b/src/plugman/search.js
index 6ca6034..474edc9 100644
--- a/src/plugman/search.js
+++ b/src/plugman/search.js
@@ -19,6 +19,6 @@
 
 var registry = require('./registry/registry');
 
-module.exports = function(search_opts) {
+module.exports = function (search_opts) {
     return registry.search(search_opts);
 };

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/uninstall.js
----------------------------------------------------------------------
diff --git a/src/plugman/uninstall.js b/src/plugman/uninstall.js
index 02a615d..7e6874b 100644
--- a/src/plugman/uninstall.js
+++ b/src/plugman/uninstall.js
@@ -1,5 +1,4 @@
-
-    /**
+/**
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
@@ -18,23 +17,21 @@
     under the License.
 */
 
-/* jshint laxcomma:true, sub:true, expr:true */
-
-var path = require('path'),
-    fs   = require('fs'),
-    semver = require('semver'),
-    shell= require('shelljs'),
-    action_stack = require('cordova-common').ActionStack,
-    dependencies = require('./util/dependencies'),
-    CordovaError = require('cordova-common').CordovaError,
-    underscore = require('underscore'),
-    Q = require('q'),
-    events = require('cordova-common').events,
-    platform_modules = require('../platforms/platforms'),
-    promiseutil = require('../util/promise-util'),
-    HooksRunner = require('../hooks/HooksRunner'),
-    cordovaUtil = require('../cordova/util'),
-    npmUninstall = require('cordova-fetch').uninstall;
+var path = require('path');
+var fs = require('fs');
+var semver = require('semver');
+var shell = require('shelljs');
+var action_stack = require('cordova-common').ActionStack;
+var dependencies = require('./util/dependencies');
+var CordovaError = require('cordova-common').CordovaError;
+var underscore = require('underscore');
+var Q = require('q');
+var events = require('cordova-common').events;
+var platform_modules = require('../platforms/platforms');
+var promiseutil = require('../util/promise-util');
+var HooksRunner = require('../hooks/HooksRunner');
+var cordovaUtil = require('../cordova/util');
+var npmUninstall = require('cordova-fetch').uninstall;
 
 var superspawn = require('cordova-common').superspawn;
 var PlatformJson = require('cordova-common').PlatformJson;
@@ -43,7 +40,7 @@ var PluginInfoProvider = require('cordova-common').PluginInfoProvider;
 // possible options: cli_variables, www_dir
 // Returns a promise.
 module.exports = uninstall;
-function uninstall(platform, project_dir, id, plugins_dir, options) {
+function uninstall (platform, project_dir, id, plugins_dir, options) {
     project_dir = cordovaUtil.convertToRealPathSafe(project_dir);
     plugins_dir = cordovaUtil.convertToRealPathSafe(plugins_dir);
 
@@ -54,18 +51,18 @@ function uninstall(platform, project_dir, id, plugins_dir, options) {
 
     // Allow `id` to be a path to a file.
     var xml_path = path.join(id, 'plugin.xml');
-    if ( fs.existsSync(xml_path) ) {
+    if (fs.existsSync(xml_path)) {
         id = options.pluginInfoProvider.get(id).id;
     }
 
     return module.exports.uninstallPlatform(platform, project_dir, id, plugins_dir, options)
-    .then(function() {
-        return module.exports.uninstallPlugin(id, plugins_dir, options);
-    });
+        .then(function () {
+            return module.exports.uninstallPlugin(id, plugins_dir, options);
+        });
 }
 
 // Returns a promise.
-module.exports.uninstallPlatform = function(platform, project_dir, id, plugins_dir, options) {
+module.exports.uninstallPlatform = function (platform, project_dir, id, plugins_dir, options) {
     project_dir = cordovaUtil.convertToRealPathSafe(project_dir);
     plugins_dir = cordovaUtil.convertToRealPathSafe(plugins_dir);
 
@@ -83,21 +80,21 @@ module.exports.uninstallPlatform = function(platform, project_dir, id, plugins_d
         return Q.reject(new CordovaError('Plugin "' + id + '" not found. Already uninstalled?'));
     }
 
-    var current_stack = new action_stack();
+    var current_stack = new action_stack(); // eslint-disable-line new-cap
 
-    return Q().then(function() {
+    return Q().then(function () {
         if (options.platformVersion) {
             return Q(options.platformVersion);
         }
         return Q(superspawn.maybeSpawn(path.join(project_dir, 'cordova', 'version'), [], { chmod: true }));
-    }).then(function(platformVersion) {
+    }).then(function (platformVersion) {
         options.platformVersion = platformVersion;
         return runUninstallPlatform(current_stack, platform, project_dir, plugin_dir, plugins_dir, options);
     });
 };
 
 // Returns a promise.
-module.exports.uninstallPlugin = function(id, plugins_dir, options) {
+module.exports.uninstallPlugin = function (id, plugins_dir, options) {
     plugins_dir = cordovaUtil.convertToRealPathSafe(plugins_dir);
 
     options = options || {};
@@ -107,37 +104,37 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
     var plugin_dir = path.join(plugins_dir, id);
 
     // @tests - important this event is checked spec/uninstall.spec.js
-    events.emit('log', 'Removing "'+ id +'"');
+    events.emit('log', 'Removing "' + id + '"');
 
     // If already removed, skip.
-    if ( !fs.existsSync(plugin_dir) ) {
-        events.emit('verbose', 'Plugin "'+ id +'" already removed ('+ plugin_dir +')');
+    if (!fs.existsSync(plugin_dir)) {
+        events.emit('verbose', 'Plugin "' + id + '" already removed (' + plugin_dir + ')');
         return Q();
     }
 
     /*
-     * Deletes plugin from plugins directory and 
+     * Deletes plugin from plugins directory and
      * node_modules directory if --fetch was supplied.
      *
      * @param {String} id   the id of the plugin being removed
      *
      * @return {Promise||Error} Returns a empty promise or a promise of doing the npm uninstall
      */
-    var doDelete = function(id) {
+    var doDelete = function (id) {
         var plugin_dir = path.join(plugins_dir, id);
-        if ( !fs.existsSync(plugin_dir) ) {
-            events.emit('verbose', 'Plugin "'+ id +'" already removed ('+ plugin_dir +')');
+        if (!fs.existsSync(plugin_dir)) {
+            events.emit('verbose', 'Plugin "' + id + '" already removed (' + plugin_dir + ')');
             return Q();
         }
-        
+
         shell.rm('-rf', plugin_dir);
-        events.emit('verbose', 'Deleted "'+ id +'"');
-        
-        if(options.fetch) {
-            //remove plugin from node_modules directory
-            return npmUninstall(id, options.projectRoot, options); 
+        events.emit('verbose', 'Deleted "' + id + '"');
+
+        if (options.fetch) {
+            // remove plugin from node_modules directory
+            return npmUninstall(id, options.projectRoot, options);
         }
-        
+
         return Q();
 
     };
@@ -150,11 +147,11 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
 
     // Recursively remove plugins which were installed as dependents (that are not top-level)
     var toDelete = [];
-    function findDependencies(pluginId) {
+    function findDependencies (pluginId) {
         var depPluginDir = path.join(plugin_dir, '..', pluginId);
         // Skip plugin check for dependencies if it does not exist (CB-7846).
-        if (!fs.existsSync(depPluginDir) ) {
-            events.emit('verbose', 'Plugin "'+ pluginId +'" does not exist ('+ depPluginDir +')');
+        if (!fs.existsSync(depPluginDir)) {
+            events.emit('verbose', 'Plugin "' + pluginId + '" does not exist (' + depPluginDir + ')');
             return;
         }
         var pluginInfo = pluginInfoProvider.get(depPluginDir);
@@ -172,71 +169,71 @@ module.exports.uninstallPlugin = function(id, plugins_dir, options) {
 
     // Okay, now we check if any of these are depended on, or top-level.
     // Find the installed platforms by whether they have a metadata file.
-    var platforms = Object.keys(platform_modules).filter(function(platform) {
+    var platforms = Object.keys(platform_modules).filter(function (platform) {
         return fs.existsSync(path.join(plugins_dir, platform + '.json'));
     });
 
     // Can have missing plugins on some platforms when not supported..
     var dependList = {};
-    platforms.forEach(function(platform) {
+    platforms.forEach(function (platform) {
         var platformJson = PlatformJson.load(plugins_dir, platform);
         var depsInfo = dependencies.generateDependencyInfo(platformJson, plugins_dir, pluginInfoProvider);
         var tlps = depsInfo.top_level_plugins;
         var deps;
 
         // Top-level deps must always be explicitely asked to remove by user
-        tlps.forEach(function(plugin_id){
-            if(top_plugin_id == plugin_id)
-                return;
+        tlps.forEach(function (plugin_id) {
+            if (top_plugin_id === plugin_id) { return; }
 
             var i = toDelete.indexOf(plugin_id);
-            if(i >= 0)
-                toDelete.splice(i, 1);
+            if (i >= 0) { toDelete.splice(i, 1); }
         });
 
-        toDelete.forEach(function(plugin) {
+        toDelete.forEach(function (plugin) {
             deps = dependencies.dependents(plugin, depsInfo, platformJson, pluginInfoProvider);
 
             var i = deps.indexOf(top_plugin_id);
-            if(i >= 0)
-                deps.splice(i, 1); // remove current/top-level plugin as blocking uninstall
+            if (i >= 0) { deps.splice(i, 1); } // remove current/top-level plugin as blocking uninstall
 
-            if(deps.length) {
+            if (deps.length) {
                 dependList[plugin] = deps.join(', ');
             }
         });
     });
 
-    var i, plugin_id, msg, delArray = [];
-    for(i in toDelete) {
+    var i;
+    var plugin_id;
+    var msg;
+    var delArray = [];
+    for (i in toDelete) {
         plugin_id = toDelete[i];
 
-        if( dependList[plugin_id] ) {
-            msg = '"' + plugin_id + '" is required by ('+ dependList[plugin_id] + ')';
-            if(options.force) {
-                events.emit('log', msg +' but forcing removal.');
+        if (dependList[plugin_id]) {
+            msg = '"' + plugin_id + '" is required by (' + dependList[plugin_id] + ')';
+            if (options.force) {
+                events.emit('log', msg + ' but forcing removal.');
             } else {
                 // @tests - error and event message is checked spec/uninstall.spec.js
                 msg += ' and cannot be removed (hint: use -f or --force)';
 
-                if(plugin_id == top_plugin_id) {
-                    return Q.reject( new CordovaError(msg) );
+                if (plugin_id === top_plugin_id) {
+                    return Q.reject(new CordovaError(msg));
                 } else {
                     events.emit('warn', msg);
                     continue;
                 }
             }
         }
-        //create an array of promises
+        // create an array of promises
         delArray.push(doDelete(plugin_id));
     }
-    //return promise.all
+    // return promise.all
     return Q.all(delArray);
 };
 
 // possible options: cli_variables, www_dir, is_top_level
 // Returns a promise
-function runUninstallPlatform(actions, platform, project_dir, plugin_dir, plugins_dir, options) {
+function runUninstallPlatform (actions, platform, project_dir, plugin_dir, plugins_dir, options) {
     var pluginInfoProvider = options.pluginInfoProvider;
     // If this plugin is not really installed, return (CB-7004).
     if (!fs.existsSync(plugin_dir)) {
@@ -253,12 +250,12 @@ function runUninstallPlatform(actions, platform, project_dir, plugin_dir, plugin
     // Check that this plugin has no dependents.
     var dependents = dependencies.dependents(plugin_id, depsInfo, platformJson, pluginInfoProvider);
 
-    if(options.is_top_level && dependents && dependents.length > 0) {
+    if (options.is_top_level && dependents && dependents.length > 0) {
         var msg = 'The plugin \'' + plugin_id + '\' is required by (' + dependents.join(', ') + ')';
-        if(options.force) {
+        if (options.force) {
             events.emit('warn', msg + ' but forcing removal');
         } else {
-            return Q.reject( new CordovaError(msg + ', skipping uninstallation. (try --force if trying to update)') );
+            return Q.reject(new CordovaError(msg + ', skipping uninstallation. (try --force if trying to update)'));
         }
     }
 
@@ -271,7 +268,7 @@ function runUninstallPlatform(actions, platform, project_dir, plugin_dir, plugin
 
         // @tests - important this event is checked spec/uninstall.spec.js
         events.emit('log', 'Uninstalling ' + danglers.length + ' dependent plugins.');
-        promise = promiseutil.Q_chainmap(danglers, function(dangler) {
+        promise = promiseutil.Q_chainmap(danglers, function (dangler) {
             var dependent_path = path.join(plugins_dir, dangler);
             var opts = underscore.extend({}, options, {
                 is_top_level: depsInfo.top_level_plugins.indexOf(dangler) > -1,
@@ -286,7 +283,7 @@ function runUninstallPlatform(actions, platform, project_dir, plugin_dir, plugin
 
     var projectRoot = cordovaUtil.isCordova();
 
-    if(projectRoot) {
+    if (projectRoot) {
 
         // using unified hooksRunner
         var hooksRunnerOptions = {
@@ -306,9 +303,9 @@ function runUninstallPlatform(actions, platform, project_dir, plugin_dir, plugin
 
         var hooksRunner = new HooksRunner(projectRoot);
 
-        return promise.then(function() {
+        return promise.then(function () {
             return hooksRunner.fire('before_plugin_uninstall', hooksRunnerOptions);
-        }).then(function() {
+        }).then(function () {
             return handleUninstall(actions, platform, pluginInfo, project_dir, options.www_dir, plugins_dir, options.is_top_level, options);
         });
     } else {
@@ -319,43 +316,43 @@ function runUninstallPlatform(actions, platform, project_dir, plugin_dir, plugin
 }
 
 // Returns a promise.
-function handleUninstall(actions, platform, pluginInfo, project_dir, www_dir, plugins_dir, is_top_level, options) {
+function handleUninstall (actions, platform, pluginInfo, project_dir, www_dir, plugins_dir, is_top_level, options) {
     events.emit('log', 'Uninstalling ' + pluginInfo.id + ' from ' + platform);
 
     // Set up platform to uninstall asset files/js modules
     // from <platform>/platform_www dir instead of <platform>/www.
     options.usePlatformWww = true;
     return platform_modules.getPlatformApi(platform, project_dir)
-    .removePlugin(pluginInfo, options)
-    .then(function(result) {
-        // Remove plugin from installed list. This already done in platform,
-        // but need to be duplicated here to remove plugin entry from project's
-        // plugin list to manage dependencies properly.
-        PlatformJson.load(plugins_dir, platform)
-            .removePlugin(pluginInfo.id, is_top_level)
-            .save();
-
-        if (platform == 'android' &&
-                semver.gte(options.platformVersion, '4.0.0-dev') &&
-                // CB-10533 since 5.2.0-dev prepBuildFiles is now called internally by android platform and
-                // no more exported from build module
-                // TODO: This might be removed once we deprecate non-PlatformApi compatible platforms support
-                semver.lte(options.platformVersion, '5.2.0-dev') &&
-                pluginInfo.getFrameworks(platform).length > 0) {
-
-            events.emit('verbose', 'Updating build files since android plugin contained <framework>');
-            var buildModule;
-            try {
-                buildModule = require(path.join(project_dir, 'cordova', 'lib', 'build'));
-            } catch (e) {
-                // Should occur only in unit tests.
-            }
-            if (buildModule && buildModule.prepBuildFiles) {
-                buildModule.prepBuildFiles();
+        .removePlugin(pluginInfo, options)
+        .then(function (result) {
+            // Remove plugin from installed list. This already done in platform,
+            // but need to be duplicated here to remove plugin entry from project's
+            // plugin list to manage dependencies properly.
+            PlatformJson.load(plugins_dir, platform)
+                .removePlugin(pluginInfo.id, is_top_level)
+                .save();
+
+            if (platform === 'android' &&
+                    semver.gte(options.platformVersion, '4.0.0-dev') &&
+                    // CB-10533 since 5.2.0-dev prepBuildFiles is now called internally by android platform and
+                    // no more exported from build module
+                    // TODO: This might be removed once we deprecate non-PlatformApi compatible platforms support
+                    semver.lte(options.platformVersion, '5.2.0-dev') &&
+                    pluginInfo.getFrameworks(platform).length > 0) {
+
+                events.emit('verbose', 'Updating build files since android plugin contained <framework>');
+                var buildModule;
+                try {
+                    buildModule = require(path.join(project_dir, 'cordova', 'lib', 'build'));
+                } catch (e) {
+                    // Should occur only in unit tests.
+                }
+                if (buildModule && buildModule.prepBuildFiles) {
+                    buildModule.prepBuildFiles();
+                }
             }
-        }
 
-        // CB-11022 propagate `removePlugin` result to the caller
-        return Q(result);
-    });
+            // CB-11022 propagate `removePlugin` result to the caller
+            return Q(result);
+        });
 }

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/util/android-project.js
----------------------------------------------------------------------
diff --git a/src/plugman/util/android-project.js b/src/plugman/util/android-project.js
index fd62c79..cdf820d 100644
--- a/src/plugman/util/android-project.js
+++ b/src/plugman/util/android-project.js
@@ -1,4 +1,4 @@
-/**
+/**
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
@@ -20,24 +20,21 @@
     Helper for Android projects configuration
 */
 
-/* jshint boss:true */
+var fs = require('fs');
+var path = require('path');
+var properties_parser = require('properties-parser');
+var shell = require('shelljs');
 
-var fs = require('fs'),
-    path = require('path'),
-    properties_parser = require('properties-parser'),
-    shell = require('shelljs');
-
-
-function addToPropertyList(projectProperties, key, value) {
+function addToPropertyList (projectProperties, key, value) {
     var i = 1;
-    while (projectProperties.get(key + '.' + i))
-        i++;
+    while (projectProperties.get(key + '.' + i)) { i++; }
 
     projectProperties.set(key + '.' + i, value);
     projectProperties.dirty = true;
 }
 
-function removeFromPropertyList(projectProperties, key, value) {
+/* eslint-disable no-cond-assign */
+function removeFromPropertyList (projectProperties, key, value) {
     var i = 1;
     var currentValue;
     while (currentValue = projectProperties.get(key + '.' + i)) {
@@ -53,8 +50,9 @@ function removeFromPropertyList(projectProperties, key, value) {
     }
     projectProperties.dirty = true;
 }
+/* eslint-enable no-cond-assign */
 
-function AndroidProject(projectDir) {
+function AndroidProject (projectDir) {
     this._propertiesEditors = {};
     this._subProjectDirs = {};
     this._dirty = false;
@@ -63,7 +61,7 @@ function AndroidProject(projectDir) {
 }
 
 AndroidProject.prototype = {
-    addSubProject: function(parentDir, subDir) {
+    addSubProject: function (parentDir, subDir) {
         var parentProjectFile = path.resolve(parentDir, 'project.properties');
         var subProjectFile = path.resolve(subDir, 'project.properties');
         var parentProperties = this._getPropertiesFile(parentProjectFile);
@@ -78,38 +76,38 @@ AndroidProject.prototype = {
 
         this._dirty = true;
     },
-    removeSubProject: function(parentDir, subDir) {
+    removeSubProject: function (parentDir, subDir) {
         var parentProjectFile = path.resolve(parentDir, 'project.properties');
         var parentProperties = this._getPropertiesFile(parentProjectFile);
         removeFromPropertyList(parentProperties, 'android.library.reference', module.exports.getRelativeLibraryPath(parentDir, subDir));
         delete this._subProjectDirs[subDir];
         this._dirty = true;
     },
-    addGradleReference: function(parentDir, subDir) {
+    addGradleReference: function (parentDir, subDir) {
         var parentProjectFile = path.resolve(parentDir, 'project.properties');
         var parentProperties = this._getPropertiesFile(parentProjectFile);
         addToPropertyList(parentProperties, 'cordova.gradle.include', module.exports.getRelativeLibraryPath(parentDir, subDir));
         this._dirty = true;
     },
-    removeGradleReference: function(parentDir, subDir) {
+    removeGradleReference: function (parentDir, subDir) {
         var parentProjectFile = path.resolve(parentDir, 'project.properties');
         var parentProperties = this._getPropertiesFile(parentProjectFile);
         removeFromPropertyList(parentProperties, 'cordova.gradle.include', module.exports.getRelativeLibraryPath(parentDir, subDir));
         this._dirty = true;
     },
-    addSystemLibrary: function(parentDir, value) {
+    addSystemLibrary: function (parentDir, value) {
         var parentProjectFile = path.resolve(parentDir, 'project.properties');
         var parentProperties = this._getPropertiesFile(parentProjectFile);
         addToPropertyList(parentProperties, 'cordova.system.library', value);
         this._dirty = true;
     },
-    removeSystemLibrary: function(parentDir, value) {
+    removeSystemLibrary: function (parentDir, value) {
         var parentProjectFile = path.resolve(parentDir, 'project.properties');
         var parentProperties = this._getPropertiesFile(parentProjectFile);
         removeFromPropertyList(parentProperties, 'cordova.system.library', value);
         this._dirty = true;
     },
-    write: function() {
+    write: function () {
         if (!this._dirty) {
             return;
         }
@@ -118,7 +116,7 @@ AndroidProject.prototype = {
         for (var filename in this._propertiesEditors) {
             var editor = this._propertiesEditors[filename];
             if (editor.dirty) {
-                // Check for parent directory existence before attempting write 
+                // Check for parent directory existence before attempting write
                 // (when uninstalling a plugin its subprojects' directories are deleted)
                 if (fs.existsSync(path.dirname(filename))) {
                     fs.writeFileSync(filename, editor.toString());
@@ -131,8 +129,7 @@ AndroidProject.prototype = {
         // no reason to keep run this command. Plus - we really want to avoid
         // relying on the presense of native SDKs within plugman.
         if (this.needsSubLibraryUpdate) {
-            for (var sub_dir in this._subProjectDirs)
-            {
+            for (var sub_dir in this._subProjectDirs) {
                 shell.exec('android update lib-project --path "' + sub_dir + '"');
             }
         }
@@ -151,11 +148,10 @@ AndroidProject.prototype = {
     }
 };
 
-
 module.exports = {
     AndroidProject: AndroidProject,
     getRelativeLibraryPath: function (parentDir, subDir) {
         var libraryPath = path.relative(parentDir, subDir);
-        return (path.sep == '\\') ? libraryPath.replace(/\\/g, '/') : libraryPath;
+        return (path.sep === '\\') ? libraryPath.replace(/\\/g, '/') : libraryPath;
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/util/default-engines.js
----------------------------------------------------------------------
diff --git a/src/plugman/util/default-engines.js b/src/plugman/util/default-engines.js
index 510ed97..b9225d8 100644
--- a/src/plugman/util/default-engines.js
+++ b/src/plugman/util/default-engines.js
@@ -19,37 +19,37 @@
 
 var path = require('path');
 
-module.exports = function(project_dir){
+module.exports = function (project_dir) {
     return {
         'cordova':
-            { 'platform':'*', 'currentVersion': require('../../../package.json').version },
+            { 'platform': '*', 'currentVersion': require('../../../package.json').version },
         'cordova-plugman':
-            { 'platform':'*', 'currentVersion': require('../../../package.json').version },
+            { 'platform': '*', 'currentVersion': require('../../../package.json').version },
         'cordova-android':
-            { 'platform':'android', 'scriptSrc': path.join(project_dir,'cordova','version') },
+            { 'platform': 'android', 'scriptSrc': path.join(project_dir, 'cordova', 'version') },
         'cordova-ios':
-            { 'platform':'ios', 'scriptSrc': path.join(project_dir,'cordova','version') },
+            { 'platform': 'ios', 'scriptSrc': path.join(project_dir, 'cordova', 'version') },
         'cordova-osx':
-            { 'platform':'osx', 'scriptSrc': path.join(project_dir,'cordova','version') },
+            { 'platform': 'osx', 'scriptSrc': path.join(project_dir, 'cordova', 'version') },
         'cordova-blackberry10':
-            { 'platform':'blackberry10', 'scriptSrc': path.join(project_dir,'cordova','version') },
+            { 'platform': 'blackberry10', 'scriptSrc': path.join(project_dir, 'cordova', 'version') },
         'cordova-wp8':
-            { 'platform':'wp8', 'scriptSrc': path.join(project_dir,'cordova','version') },
+            { 'platform': 'wp8', 'scriptSrc': path.join(project_dir, 'cordova', 'version') },
         'cordova-windows':
-            { 'platform':'windows', 'scriptSrc': path.join(project_dir,'cordova','version') },
-        'apple-xcode' :
-            { 'platform':'ios', 'scriptSrc':  path.join(project_dir,'cordova','apple_xcode_version') },
-        'apple-ios' :
-            { 'platform':'ios', 'scriptSrc': path.join(project_dir,'cordova','apple_ios_version') },
-        'apple-osx' :
-            { 'platform':'ios', 'scriptSrc': path.join(project_dir,'cordova','apple_osx_version') },
-        'blackberry-ndk' :
-            { 'platform':'blackberry10', 'scriptSrc': path.join(project_dir,'cordova','bb10-ndk-version') },
-        'android-sdk' :
-            { 'platform':'android', 'scriptSrc': path.join(project_dir,'cordova','android_sdk_version') },
-        'windows-os' :
-            { 'platform':'wp8|windows8', 'scriptSrc': path.join(project_dir,'cordova','win_os_version') },
-        'windows-sdk' :
-            { 'platform':'wp8|windows8', 'scriptSrc': path.join(project_dir,'cordova','win_sdk_version') }
+            { 'platform': 'windows', 'scriptSrc': path.join(project_dir, 'cordova', 'version') },
+        'apple-xcode':
+            { 'platform': 'ios', 'scriptSrc': path.join(project_dir, 'cordova', 'apple_xcode_version') },
+        'apple-ios':
+            { 'platform': 'ios', 'scriptSrc': path.join(project_dir, 'cordova', 'apple_ios_version') },
+        'apple-osx':
+            { 'platform': 'ios', 'scriptSrc': path.join(project_dir, 'cordova', 'apple_osx_version') },
+        'blackberry-ndk':
+            { 'platform': 'blackberry10', 'scriptSrc': path.join(project_dir, 'cordova', 'bb10-ndk-version') },
+        'android-sdk':
+            { 'platform': 'android', 'scriptSrc': path.join(project_dir, 'cordova', 'android_sdk_version') },
+        'windows-os':
+            { 'platform': 'wp8|windows8', 'scriptSrc': path.join(project_dir, 'cordova', 'win_os_version') },
+        'windows-sdk':
+            { 'platform': 'wp8|windows8', 'scriptSrc': path.join(project_dir, 'cordova', 'win_sdk_version') }
     };
 };

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/util/dependencies.js
----------------------------------------------------------------------
diff --git a/src/plugman/util/dependencies.js b/src/plugman/util/dependencies.js
index 8c5d9fe..fa3e4c1 100644
--- a/src/plugman/util/dependencies.js
+++ b/src/plugman/util/dependencies.js
@@ -17,67 +17,62 @@
     under the License.
 */
 
-/* jshint expr:true */
+var dep_graph = require('dep-graph');
+var path = require('path');
+var fs = require('fs');
+var underscore = require('underscore');
+var events = require('cordova-common').events;
+var pkg;
 
-var dep_graph = require('dep-graph'),
-    path = require('path'),
-    fs = require('fs'),
-    underscore = require('underscore'),
-    events = require('cordova-common').events,
-    package;
+module.exports = pkg = {
 
-module.exports = package = {
-
-    generateDependencyInfo:function(platformJson, plugins_dir, pluginInfoProvider) {
+    generateDependencyInfo: function (platformJson, plugins_dir, pluginInfoProvider) {
         var json = platformJson.root;
 
         // TODO: store whole dependency tree in plugins/[platform].json
         // in case plugins are forcefully removed...
         var tlps = [];
-        var graph = new dep_graph();
-        Object.keys(json.installed_plugins).forEach(function(plugin_id) {
+        var graph = new dep_graph(); // eslint-disable-line new-cap
+        Object.keys(json.installed_plugins).forEach(function (plugin_id) {
             tlps.push(plugin_id);
 
             var plugin_dir = path.join(plugins_dir, plugin_id);
             var pluginInfo = pluginInfoProvider.get(plugin_dir);
             var deps = pluginInfo.getDependencies(platformJson.platform);
-            deps.forEach(function(dep) {
+            deps.forEach(function (dep) {
                 graph.add(plugin_id, dep.id);
             });
         });
-        Object.keys(json.dependent_plugins).forEach(function(plugin_id) {
+        Object.keys(json.dependent_plugins).forEach(function (plugin_id) {
             var plugin_dir = path.join(plugins_dir, plugin_id);
             // dependency plugin does not exist (CB-7846)
             if (!fs.existsSync(plugin_dir)) {
-                events.emit('verbose', 'Plugin "'+ plugin_id +'" does not exist ('+ plugin_dir+')');
+                events.emit('verbose', 'Plugin "' + plugin_id + '" does not exist (' + plugin_dir + ')');
                 return;
             }
 
             var pluginInfo = pluginInfoProvider.get(plugin_dir);
             var deps = pluginInfo.getDependencies(platformJson.platform);
-            deps.forEach(function(dep) {
+            deps.forEach(function (dep) {
                 graph.add(plugin_id, dep.id);
             });
         });
 
         return {
-            graph:graph,
-            top_level_plugins:tlps
+            graph: graph,
+            top_level_plugins: tlps
         };
     },
 
     // Returns a list of top-level plugins which are (transitively) dependent on the given plugin.
-    dependents: function(plugin_id, plugins_dir, platformJson, pluginInfoProvider) {
+    dependents: function (plugin_id, plugins_dir, platformJson, pluginInfoProvider) {
         var depsInfo;
-        if(typeof plugins_dir == 'object')
-            depsInfo = plugins_dir;
-        else
-            depsInfo = package.generateDependencyInfo(platformJson, plugins_dir, pluginInfoProvider);
+        if (typeof plugins_dir === 'object') { depsInfo = plugins_dir; } else { depsInfo = pkg.generateDependencyInfo(platformJson, plugins_dir, pluginInfoProvider); }
 
         var graph = depsInfo.graph;
         var tlps = depsInfo.top_level_plugins;
-        var dependents = tlps.filter(function(tlp) {
-            return tlp != plugin_id && graph.getChain(tlp).indexOf(plugin_id) >= 0;
+        var dependents = tlps.filter(function (tlp) {
+            return tlp !== plugin_id && graph.getChain(tlp).indexOf(plugin_id) >= 0;
         });
 
         return dependents;
@@ -85,20 +80,17 @@ module.exports = package = {
 
     // Returns a list of plugins which the given plugin depends on, for which it is the only dependent.
     // In other words, if the given plugin were deleted, these dangling dependencies should be deleted too.
-    danglers: function(plugin_id, plugins_dir, platformJson, pluginInfoProvider) {
+    danglers: function (plugin_id, plugins_dir, platformJson, pluginInfoProvider) {
         var depsInfo;
-        if(typeof plugins_dir == 'object')
-            depsInfo = plugins_dir;
-        else
-            depsInfo = package.generateDependencyInfo(platformJson, plugins_dir, pluginInfoProvider);
+        if (typeof plugins_dir === 'object') { depsInfo = plugins_dir; } else { depsInfo = pkg.generateDependencyInfo(platformJson, plugins_dir, pluginInfoProvider); }
 
         var graph = depsInfo.graph;
         var dependencies = graph.getChain(plugin_id);
 
         var tlps = depsInfo.top_level_plugins;
         var diff_arr = [];
-        tlps.forEach(function(tlp) {
-            if (tlp != plugin_id) {
+        tlps.forEach(function (tlp) {
+            if (tlp !== plugin_id) {
                 diff_arr.push(graph.getChain(tlp));
             }
         });
@@ -108,7 +100,7 @@ module.exports = package = {
         var danglers = underscore.difference.apply(null, diff_arr);
 
         // Ensure no top-level plugins are tagged as danglers.
-        danglers = danglers && danglers.filter(function(x) { return tlps.indexOf(x) < 0; });
+        danglers = danglers && danglers.filter(function (x) { return tlps.indexOf(x) < 0; });
         return danglers;
     }
 };

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/util/metadata.js
----------------------------------------------------------------------
diff --git a/src/plugman/util/metadata.js b/src/plugman/util/metadata.js
index 435cab0..e306bfb 100644
--- a/src/plugman/util/metadata.js
+++ b/src/plugman/util/metadata.js
@@ -22,7 +22,7 @@ var path = require('path');
 
 var cachedJson = null;
 
-function getJson(pluginsDir) {
+function getJson (pluginsDir) {
     if (!cachedJson) {
         var fetchJsonPath = path.join(pluginsDir, 'fetch.json');
         if (fs.existsSync(fetchJsonPath)) {
@@ -34,7 +34,7 @@ function getJson(pluginsDir) {
     return cachedJson;
 }
 
-exports.get_fetch_metadata = function(plugin_dir) {
+exports.get_fetch_metadata = function (plugin_dir) {
     var pluginsDir = path.dirname(plugin_dir);
     var pluginId = path.basename(plugin_dir);
 
@@ -52,17 +52,16 @@ exports.get_fetch_metadata = function(plugin_dir) {
     return {};
 };
 
-exports.save_fetch_metadata = function(pluginsDir, pluginId, data) {
+exports.save_fetch_metadata = function (pluginsDir, pluginId, data) {
     var metadataJson = getJson(pluginsDir);
     metadataJson[pluginId] = data;
     var fetchJsonPath = path.join(pluginsDir, 'fetch.json');
     fs.writeFileSync(fetchJsonPath, JSON.stringify(metadataJson, null, 2), 'utf-8');
 };
 
-exports.remove_fetch_metadata = function(pluginsDir, pluginId){
+exports.remove_fetch_metadata = function (pluginsDir, pluginId) {
     var metadataJson = getJson(pluginsDir);
     delete metadataJson[pluginId];
     var fetchJsonPath = path.join(pluginsDir, 'fetch.json');
     fs.writeFileSync(fetchJsonPath, JSON.stringify(metadataJson, null, 2), 'utf-8');
 };
-

http://git-wip-us.apache.org/repos/asf/cordova-lib/blob/17438d2b/src/plugman/util/plist-helpers.js
----------------------------------------------------------------------
diff --git a/src/plugman/util/plist-helpers.js b/src/plugman/util/plist-helpers.js
index 8d5384f..230af90 100644
--- a/src/plugman/util/plist-helpers.js
+++ b/src/plugman/util/plist-helpers.js
@@ -1,4 +1,4 @@
- /**
+/**
     Licensed to the Apache Software Foundation (ASF) under one
     or more contributor license agreements.  See the NOTICE file
     distributed with this work for additional information
@@ -15,32 +15,31 @@
     KIND, either express or implied.  See the License for the
     specific language governing permissions and limitations
     under the License.
-*/ 
+*/
 
 // contains PLIST utility functions
-var __     = require('underscore');
+var __ = require('underscore');
 var plist = require('plist');
 
 // adds node to doc at selector
 module.exports.graftPLIST = graftPLIST;
-function graftPLIST(doc, xml, selector) {
-    var obj = plist.parse('<plist>'+xml+'</plist>');
+function graftPLIST (doc, xml, selector) {
+    var obj = plist.parse('<plist>' + xml + '</plist>');
 
     var node = doc[selector];
-    if (node && Array.isArray(node) && Array.isArray(obj)){
+    if (node && Array.isArray(node) && Array.isArray(obj)) {
         node = node.concat(obj);
-        for (var i =0;i<node.length; i++){
-            for (var j=i+1; j<node.length; ++j) {
-              if (nodeEqual(node[i], node[j]))
-                    node.splice(j--,1);
+        for (var i = 0; i < node.length; i++) {
+            for (var j = i + 1; j < node.length; ++j) {
+                if (nodeEqual(node[i], node[j])) { node.splice(j--, 1); }
             }
         }
         doc[selector] = node;
     } else {
-        //plist uses objects for <dict>. If we have two dicts we merge them instead of
+        // plist uses objects for <dict>. If we have two dicts we merge them instead of
         // overriding the old one. See CB-6472
-        if (node && __.isObject(node) && __.isObject(obj) && !__.isDate(node) && !__.isDate(obj)){//arrays checked above
-            __.extend(obj,node);
+        if (node && __.isObject(node) && __.isObject(obj) && !__.isDate(node) && !__.isDate(obj)) { // arrays checked above
+            __.extend(obj, node);
         }
         doc[selector] = obj;
     }
@@ -50,15 +49,15 @@ function graftPLIST(doc, xml, selector) {
 
 // removes node from doc at selector
 module.exports.prunePLIST = prunePLIST;
-function prunePLIST(doc, xml, selector) {
-    var obj = plist.parse('<plist>'+xml+'</plist>');
+function prunePLIST (doc, xml, selector) {
+    var obj = plist.parse('<plist>' + xml + '</plist>');
 
     pruneOBJECT(doc, selector, obj);
 
     return true;
 }
 
-function pruneOBJECT(doc, selector, fragment) {
+function pruneOBJECT (doc, selector, fragment) {
     if (Array.isArray(fragment) && Array.isArray(doc[selector])) {
         var empty = true;
         for (var i in fragment) {
@@ -66,13 +65,11 @@ function pruneOBJECT(doc, selector, fragment) {
                 empty = pruneOBJECT(doc[selector], j, fragment[i]) && empty;
             }
         }
-        if (empty)
-        {
+        if (empty) {
             delete doc[selector];
             return true;
         }
-    }
-    else if (nodeEqual(doc[selector], fragment)) {
+    } else if (nodeEqual(doc[selector], fragment)) {
         delete doc[selector];
         return true;
     }
@@ -80,14 +77,11 @@ function pruneOBJECT(doc, selector, fragment) {
     return false;
 }
 
-function nodeEqual(node1, node2) {
-    if (typeof node1 != typeof node2)
-        return false;
-    else if (typeof node1 == 'string') {
-        node2 = escapeRE(node2).replace(/\\\$\S+/gm,'(.*?)');
+function nodeEqual (node1, node2) {
+    if (typeof node1 !== typeof node2) { return false; } else if (typeof node1 === 'string') {
+        node2 = escapeRE(node2).replace(/\\\$\S+/gm, '(.*?)');
         return new RegExp('^' + node2 + '$').test(node1);
-    }
-    else {
+    } else {
         for (var key in node2) {
             if (!nodeEqual(node1[key], node2[key])) return false;
         }
@@ -96,6 +90,6 @@ function nodeEqual(node1, node2) {
 }
 
 // escape string for use in regex
-function escapeRE(str) {
-    return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&');
+function escapeRE (str) {
+    return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); // eslint-disable-line no-useless-escape
 }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@cordova.apache.org
For additional commands, e-mail: commits-help@cordova.apache.org


Mime
View raw message