cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From audre...@apache.org
Subject [4/7] cordova-windows git commit: CB-12895 : setup eslint and removed jshint
Date Fri, 14 Jul 2017 22:57:44 GMT
http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/ConfigParser.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/ConfigParser.js b/template/cordova/lib/ConfigParser.js
index 11a14e2..a783ccb 100644
--- a/template/cordova/lib/ConfigParser.js
+++ b/template/cordova/lib/ConfigParser.js
@@ -23,7 +23,7 @@ var util = require('util');
 var Version = require('./Version');
 var ConfigParser = require('cordova-common').ConfigParser;
 
-var BASE_UAP_VERSION    = new Version(10, 0, 10240, 0);
+var BASE_UAP_VERSION = new Version(10, 0, 10240, 0);
 
 /**
  * A wrapper arount config.xml file, based on cordova-common implementation,
@@ -34,13 +34,13 @@ var BASE_UAP_VERSION    = new Version(10, 0, 10240, 0);
  *
  * @param  {String}  path  Path to config.xml file
  */
-function WindowsConfigParser(path) {
+function WindowsConfigParser (path) {
     ConfigParser.call(this, path);
 }
 
 util.inherits(WindowsConfigParser, ConfigParser);
 
-WindowsConfigParser.prototype.startPage = function() {
+WindowsConfigParser.prototype.startPage = function () {
     var content = this.doc.find('content');
     if (content) {
         return content.attrib.src;
@@ -48,14 +48,14 @@ WindowsConfigParser.prototype.startPage = function() {
     return null;
 };
 
-WindowsConfigParser.prototype.windows_packageVersion = function() {
+WindowsConfigParser.prototype.windows_packageVersion = function () {
     return this.doc.getroot().attrib['windows-packageVersion'];
 };
 
-WindowsConfigParser.prototype.getMatchingPreferences = function(regexp) {
+WindowsConfigParser.prototype.getMatchingPreferences = function (regexp) {
     var preferences = this.doc.findall('preference');
     var result = [];
-    preferences.forEach(function(preference) {
+    preferences.forEach(function (preference) {
         if (regexp.test(preference.attrib.name)) {
             result.push({ name: preference.attrib.name, value: preference.attrib.value });
         }
@@ -64,16 +64,15 @@ WindowsConfigParser.prototype.getMatchingPreferences = function(regexp) {
     return result;
 };
 
-WindowsConfigParser.prototype.getWindowsTargetVersion = function() {
+WindowsConfigParser.prototype.getWindowsTargetVersion = function () {
     var preference = this.getPreference('windows-target-version');
 
-    if (!preference)
-        preference = '8.1'; // default is 8.1.
+    if (!preference) { preference = '8.1'; } // default is 8.1.
 
     return preference;
 };
 
-WindowsConfigParser.prototype.getUAPTargetMinVersion = function() {
+WindowsConfigParser.prototype.getUAPTargetMinVersion = function () {
     var preference = this.getPreference('uap-target-min-version');
 
     if (!preference) {
@@ -83,18 +82,16 @@ WindowsConfigParser.prototype.getUAPTargetMinVersion = function() {
     return preference;
 };
 
-WindowsConfigParser.prototype.getWindowsPhoneTargetVersion = function() {
+WindowsConfigParser.prototype.getWindowsPhoneTargetVersion = function () {
     // This is a little more complicated than the previous one.
     // 1. Check for an explicit preference.  If the preference is set explicitly, return that, irrespective of whether it is valid
     // 2. Get the Windows baseline version.  If it's equivalent to 8.0, bump it to 8.1.
     // 3. Return the Windows baseline version.
     var explicitPreference = this.getPreference('windows-phone-target-version');
-    if (explicitPreference)
-        return explicitPreference;
+    if (explicitPreference) { return explicitPreference; }
 
     var windowsTargetVersion = this.getWindowsTargetVersion();
-    if (windowsTargetVersion === '8' || windowsTargetVersion === '8.0')
-        windowsTargetVersion = '8.1';
+    if (windowsTargetVersion === '8' || windowsTargetVersion === '8.0') { windowsTargetVersion = '8.1'; }
 
     return windowsTargetVersion;
 };
@@ -114,44 +111,41 @@ WindowsConfigParser.prototype.getWindowsPhoneTargetVersion = function() {
  * @exception {RangeError} Thrown if a Version string is badly formed.
  */
 WindowsConfigParser.prototype.getAllMinMaxUAPVersions = function () {
-    var uapVersionPreferenceTest = /(Microsoft.+?|Windows.+?)\-(MinVersion|MaxVersionTested)/i;
+    var uapVersionPreferenceTest = /(Microsoft.+?|Windows.+?)\-(MinVersion|MaxVersionTested)/i; /* eslint no-useless-escape : 0 */
     var platformBag = Object.create(null);
 
     this.getMatchingPreferences(uapVersionPreferenceTest)
-    .forEach(function(verPref) {
-        var matches = uapVersionPreferenceTest.exec(verPref.name);
-        // 'matches' should look like: ['Windows.Universal-MinVersion', 'Windows.Universal', 'MinVersion']
-        var platformName = matches[1];
-        var versionPropertyName = matches[2];
-
-        var platformVersionSet = platformBag[platformName];
-        if (typeof platformVersionSet === 'undefined') {
-            platformVersionSet = { };
-            platformBag[platformName] = platformVersionSet;
-        }
+        .forEach(function (verPref) {
+            var matches = uapVersionPreferenceTest.exec(verPref.name);
+            // 'matches' should look like: ['Windows.Universal-MinVersion', 'Windows.Universal', 'MinVersion']
+            var platformName = matches[1];
+            var versionPropertyName = matches[2];
+
+            var platformVersionSet = platformBag[platformName];
+            if (typeof platformVersionSet === 'undefined') {
+                platformVersionSet = { };
+                platformBag[platformName] = platformVersionSet;
+            }
 
-        var versionTest = Version.tryParse(verPref.value);
-        if (!versionTest) {
-            throw new RangeError('Could not parse a valid version from the string "' + verPref.value + '" of platform-boundary "' + verPref.name + '".');
-        }
+            var versionTest = Version.tryParse(verPref.value);
+            if (!versionTest) {
+                throw new RangeError('Could not parse a valid version from the string "' + verPref.value + '" of platform-boundary "' + verPref.name + '".');
+            }
 
-        platformVersionSet[versionPropertyName] = versionTest;
-    });
+            platformVersionSet[versionPropertyName] = versionTest;
+        });
 
     for (var platformName in platformBag) {
         // Go through each and make sure there are min/max set
         var versionPref = platformBag[platformName];
         if (!versionPref.MaxVersionTested && !!versionPref.MinVersion) { // min is set, but max is not
             versionPref.MaxVersionTested = versionPref.MinVersion;
-        }
-        else if (!versionPref.MinVersion && !!versionPref.MaxVersionTested) { // max is set, min is not
+        } else if (!versionPref.MinVersion && !!versionPref.MaxVersionTested) { // max is set, min is not
             versionPref.MinVersion = versionPref.MaxVersionTested;
-        }
-        else if (!versionPref.MinVersion && !versionPref.MaxVersionTested) { // neither are set
+        } else if (!versionPref.MinVersion && !versionPref.MaxVersionTested) { // neither are set
             versionPref.MinVersion = BASE_UAP_VERSION;
             versionPref.MaxVersionTested = BASE_UAP_VERSION;
-        }
-        else { // both are set
+        } else { // both are set
             if (versionPref.MinVersion.gt(versionPref.MaxVersionTested)) {
                 versionPref.MaxVersionTested = versionPref.MinVersion;
             }
@@ -166,13 +160,13 @@ WindowsConfigParser.prototype.getAllMinMaxUAPVersions = function () {
         return {
             Name: platformName,
             MinVersion: platformBag[platformName].MinVersion.toString(),
-            MaxVersionTested: platformBag[platformName].MaxVersionTested.toString(),
+            MaxVersionTested: platformBag[platformName].MaxVersionTested.toString()
         };
     });
 };
 
 // Returns the widget defaultLocale
-WindowsConfigParser.prototype.defaultLocale = function() {
+WindowsConfigParser.prototype.defaultLocale = function () {
     return this.doc.getroot().attrib['defaultlocale'];
 };
 
@@ -180,14 +174,14 @@ WindowsConfigParser.prototype.defaultLocale = function() {
  * Checks to see whether access rules or
  * @return {boolean} True if the config specifies remote URIs for access or start; false otherwise.
  */
-WindowsConfigParser.prototype.hasRemoteUris = function() {
+WindowsConfigParser.prototype.hasRemoteUris = function () {
     var test = /(https?|ms-appx-web):\/\//i;
 
     return test.test(this.startPage) ||
         this.getAllowNavigations()
-        .some(function(rule) {
-            return test.test(rule.href);
-        });
+            .some(function (rule) {
+                return test.test(rule.href);
+            });
 };
 
 module.exports = WindowsConfigParser;

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/JsprojManager.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/JsprojManager.js b/template/cordova/lib/JsprojManager.js
index 28b2fa3..27096a3 100644
--- a/template/cordova/lib/JsprojManager.js
+++ b/template/cordova/lib/JsprojManager.js
@@ -17,8 +17,6 @@
  under the License.
  */
 
-/* jshint quotmark:false */
-
 /*
  Helper for dealing with Windows Store JS app .jsproj files
  */
@@ -34,31 +32,30 @@ var PluginHandler = require('./PluginHandler');
 var events = require('cordova-common').events;
 var CordovaError = require('cordova-common').CordovaError;
 var xml_helpers = require('cordova-common').xmlHelpers;
-var AppxManifest = require('./AppxManifest');
 
-var WinCSharpProjectTypeGUID = "{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}";  // .csproj
-var WinCplusplusProjectTypeGUID = "{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}";  // .vcxproj
+var WinCSharpProjectTypeGUID = '{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}'; // .csproj
+var WinCplusplusProjectTypeGUID = '{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}'; // .vcxproj
 
 // Match a JavaScript Project
 var JSPROJ_REGEXP = /(Project\("\{262852C6-CD72-467D-83FE-5EEB1973A190}"\)\s*=\s*"[^"]+",\s*"[^"]+",\s*"\{[0-9a-f\-]+}"[^\r\n]*[\r\n]*)/gi;
 
 // Chars in a string that need to be escaped when used in a RegExp
-var ESCAPE_REGEXP = /([.?*+\^$\[\]\\(){}|\-])/g;
+var ESCAPE_REGEXP = /([.?*+\^$\[\]\\(){}|\-])/g; /* eslint no-useless-escape : 0 */
 
-function jsprojManager(location) {
+function jsprojManager (location) {
     this.root = path.dirname(location);
-    this.isUniversalWindowsApp = path.extname(location).toLowerCase() === ".projitems";
+    this.isUniversalWindowsApp = path.extname(location).toLowerCase() === '.projitems';
     this.projects = [];
     this.master = this.isUniversalWindowsApp ? new proj(location) : new jsproj(location);
-    this.projectFolder = path.dirname(location);
+    this.projectFolder = path.dirname(location); /* eslint new-cap : 0 */
     this.www = path.join(this.root, 'www');
     this.platformWww = path.join(this.root, 'platform_www');
 }
 
-function getProjectName(pluginProjectXML, relative_path) {
-    var projNameElt = pluginProjectXML.find("PropertyGroup/ProjectName");
+function getProjectName (pluginProjectXML, relative_path) {
+    var projNameElt = pluginProjectXML.find('PropertyGroup/ProjectName');
     // Falling back on project file name in case ProjectName is missing
-    return !!projNameElt ? projNameElt.text : path.basename(relative_path, path.extname(relative_path));
+    return projNameElt ? projNameElt.text : path.basename(relative_path, path.extname(relative_path));
 }
 
 jsprojManager.getProject = function (directory) {
@@ -73,10 +70,10 @@ jsprojManager.getProject = function (directory) {
 jsprojManager.prototype = {
     _projects: null,
 
-    getPackageName: function() {
+    getPackageName: function () {
         // CB-10394 Do not cache manifest file while getting package name to avoid problems
         // with windows.appxmanifest cached twice (here and in ConfigFile module)
-        return AppxManifest.get(path.join(this.root, 'package.windows.appxmanifest'), /*ignoreCache=*/true)
+        return AppxManifest.get(path.join(this.root, 'package.windows.appxmanifest'), /* ignoreCache= */true)
             .getProperties().getDisplayName();
     },
 
@@ -144,9 +141,9 @@ jsprojManager.prototype = {
         var children = [hint_path];
 
         var extName = path.extname(relPath);
-        if (extName === ".winmd") {
-            var mdFileTag = new et.Element("IsWinMDFile");
-            mdFileTag.text = "true";
+        if (extName === '.winmd') {
+            var mdFileTag = new et.Element('IsWinMDFile');
+            mdFileTag.text = 'true';
             children.push(mdFileTag);
         }
 
@@ -195,18 +192,18 @@ jsprojManager.prototype = {
         var pluginProjectXML = xml_helpers.parseElementtreeSync(path.resolve(this.projectFolder, relative_path));
 
         // find the guid + name of the referenced project
-        var projectGuid = pluginProjectXML.find("PropertyGroup/ProjectGuid").text;
+        var projectGuid = pluginProjectXML.find('PropertyGroup/ProjectGuid').text;
         var projName = getProjectName(pluginProjectXML, relative_path);
 
         // get the project type
         var projectTypeGuid = getProjectTypeGuid(relative_path);
         if (!projectTypeGuid) {
-            throw new CordovaError("Unrecognized project type at " + relative_path + " (not .csproj or .vcxproj)");
+            throw new CordovaError('Unrecognized project type at ' + relative_path + ' (not .csproj or .vcxproj)');
         }
 
-        var preInsertText = "\tProjectSection(ProjectDependencies) = postProject\r\n" +
-            "\t\t" + projectGuid + "=" + projectGuid + "\r\n" +
-            "\tEndProjectSection\r\n";
+        var preInsertText = '\tProjectSection(ProjectDependencies) = postProject\r\n' +
+            '\t\t' + projectGuid + '=' + projectGuid + '\r\n' +
+            '\tEndProjectSection\r\n';
         var postInsertText = '\r\nProject("' + projectTypeGuid + '") = "' +
             projName + '", "' + inserted_path + '", ' +
             '"' + projectGuid + '"\r\nEndProject';
@@ -222,7 +219,7 @@ jsprojManager.prototype = {
 
         // There may be multiple solution files (for different VS versions) - process them all
         getSolutionPaths(this.projectFolder).forEach(function (solutionPath) {
-            var solText = fs.readFileSync(solutionPath, {encoding: "utf8"});
+            var solText = fs.readFileSync(solutionPath, {encoding: 'utf8'});
 
             if (useProjItems) {
                 // Insert a project dependency into every jsproj in the solution.
@@ -233,7 +230,7 @@ jsprojManager.prototype = {
                 });
 
                 if (!jsProjectFound) {
-                    throw new CordovaError("No jsproj found in solution");
+                    throw new CordovaError('No jsproj found in solution');
                 }
             } else {
                 // Insert a project dependency only for projects that match specified target and version
@@ -246,14 +243,14 @@ jsprojManager.prototype = {
 
             // Add the project after existing projects. Note that this fairly simplistic check should be fine, since the last
             // EndProject in the file should actually be an EndProject (and not an EndProjectSection, for example).
-            var pos = solText.lastIndexOf("EndProject");
+            var pos = solText.lastIndexOf('EndProject');
             if (pos === -1) {
-                throw new Error("No EndProject found in solution");
+                throw new Error('No EndProject found in solution');
             }
             pos += 10; // Move pos to the end of EndProject text
             solText = solText.slice(0, pos) + postInsertText + solText.slice(pos);
 
-            fs.writeFileSync(solutionPath, solText, {encoding: "utf8"});
+            fs.writeFileSync(solutionPath, solText, {encoding: 'utf8'});
         });
 
         // Add the ItemGroup/ProjectReference to each matching cordova project :
@@ -274,13 +271,13 @@ jsprojManager.prototype = {
 
         // find the guid + name of the referenced project
         var pluginProjectXML = xml_helpers.parseElementtreeSync(path.resolve(this.projectFolder, relative_path));
-        var projectGuid = pluginProjectXML.find("PropertyGroup/ProjectGuid").text;
+        var projectGuid = pluginProjectXML.find('PropertyGroup/ProjectGuid').text;
         var projName = getProjectName(pluginProjectXML, relative_path);
 
         // get the project type
         var projectTypeGuid = getProjectTypeGuid(relative_path);
         if (!projectTypeGuid) {
-            throw new Error("Unrecognized project type at " + relative_path + " (not .csproj or .vcxproj)");
+            throw new Error('Unrecognized project type at ' + relative_path + ' (not .csproj or .vcxproj)');
         }
 
         var preInsertTextRegExp = getProjectReferencePreInsertRegExp(projectGuid);
@@ -288,20 +285,20 @@ jsprojManager.prototype = {
 
         // There may be multiple solutions (for different VS versions) - process them all
         getSolutionPaths(this.projectFolder).forEach(function (solutionPath) {
-            var solText = fs.readFileSync(solutionPath, {encoding: "utf8"});
+            var solText = fs.readFileSync(solutionPath, {encoding: 'utf8'});
 
             // To be safe (to handle subtle changes in formatting, for example), use a RegExp to find and remove
             // preInsertText and postInsertText
 
             solText = solText.replace(preInsertTextRegExp, function () {
-                return "";
+                return '';
             });
 
             solText = solText.replace(postInsertTextRegExp, function () {
-                return "";
+                return '';
             });
 
-            fs.writeFileSync(solutionPath, solText, {encoding: "utf8"});
+            fs.writeFileSync(solutionPath, solText, {encoding: 'utf8'});
         });
 
         this._getMatchingProjects(targetConditions).forEach(function (project) {
@@ -331,7 +328,7 @@ jsprojManager.prototype = {
         return [this.master];
     },
 
-    get projects() {
+    get projects () {
         var projects = this._projects;
         if (!projects) {
             projects = [];
@@ -360,12 +357,12 @@ jsprojManager.prototype.getUninstaller = function (type) {
     return PluginHandler.getUninstaller(type);
 };
 
-function getProjectReferencePreInsertRegExp(projectGuid) {
+function getProjectReferencePreInsertRegExp (projectGuid) {
     projectGuid = escapeRegExpString(projectGuid);
-    return new RegExp("\\s*ProjectSection\\(ProjectDependencies\\)\\s*=\\s*postProject\\s*" + projectGuid + "\\s*=\\s*" + projectGuid + "\\s*EndProjectSection", "gi");
+    return new RegExp('\\s*ProjectSection\\(ProjectDependencies\\)\\s*=\\s*postProject\\s*' + projectGuid + '\\s*=\\s*' + projectGuid + '\\s*EndProjectSection', 'gi');
 }
 
-function getProjectReferencePostInsertRegExp(projName, projectGuid, relative_path, projectTypeGuid) {
+function getProjectReferencePostInsertRegExp (projName, projectGuid, relative_path, projectTypeGuid) {
     projName = escapeRegExpString(projName);
     projectGuid = escapeRegExpString(projectGuid);
     relative_path = escapeRegExpString(relative_path);
@@ -373,31 +370,31 @@ function getProjectReferencePostInsertRegExp(projName, projectGuid, relative_pat
     return new RegExp('\\s*Project\\("' + projectTypeGuid + '"\\)\\s*=\\s*"' + projName + '"\\s*,\\s*"' + relative_path + '"\\s*,\\s*"' + projectGuid + '"\\s*EndProject', 'gi');
 }
 
-function getSolutionPaths(projectFolder) {
-    return shell.ls(path.join(projectFolder, "*.sln"));
+function getSolutionPaths (projectFolder) {
+    return shell.ls(path.join(projectFolder, '*.sln'));
 }
 
-function escapeRegExpString(regExpString) {
-    return regExpString.replace(ESCAPE_REGEXP, "\\$1");
+function escapeRegExpString (regExpString) {
+    return regExpString.replace(ESCAPE_REGEXP, '\\$1');
 }
 
-function getJsProjRegExForProject(projectFile) {
+function getJsProjRegExForProject (projectFile) {
     projectFile = escapeRegExpString(projectFile);
     return new RegExp('(Project\\("\\{262852C6-CD72-467D-83FE-5EEB1973A190}"\\)\\s*=\\s*"[^"]+",\\s*"' + projectFile + '",\\s*"\\{[0-9a-f\\-]+}"[^\\r\\n]*[\\r\\n]*)', 'gi');
 }
 
-function getProjectTypeGuid(projectPath) {
+function getProjectTypeGuid (projectPath) {
     switch (path.extname(projectPath)) {
-        case ".vcxproj":
-            return WinCplusplusProjectTypeGUID;
+    case '.vcxproj':
+        return WinCplusplusProjectTypeGUID;
 
-        case ".csproj":
-            return WinCSharpProjectTypeGUID;
+    case '.csproj':
+        return WinCSharpProjectTypeGUID;
     }
     return null;
 }
 
-function createItemGroupElement(path, incText, targetConditions, children) {
+function createItemGroupElement (path, incText, targetConditions, children) {
     path = path.split('/');
     path.reverse();
 
@@ -426,15 +423,15 @@ function createItemGroupElement(path, incText, targetConditions, children) {
     return lastElement;
 }
 
-function getDeviceTarget(targetConditions) {
+function getDeviceTarget (targetConditions) {
     var target = targetConditions.deviceTarget;
     if (target) {
         target = target.toLowerCase().trim();
-        if (target === "all") {
+        if (target === 'all') {
             target = null;
-        } else if (target === "win") {
+        } else if (target === 'win') {
             // Allow "win" as alternative to "windows"
-            target = "windows";
+            target = 'windows';
         } else if (target !== 'phone' && target !== 'windows') {
             throw new Error('Invalid device-target attribute (must be "all", "phone", "windows" or "win"): ' + target);
         }
@@ -442,7 +439,7 @@ function getDeviceTarget(targetConditions) {
     return target;
 }
 
-function getVersions(targetConditions) {
+function getVersions (targetConditions) {
     var versions = targetConditions.versions;
     if (versions && !semver.validRange(versions, /* loose */ true)) {
         throw new Error('Invalid versions attribute (must be a valid semantic version range): ' + versions);
@@ -450,10 +447,9 @@ function getVersions(targetConditions) {
     return versions;
 }
 
-
 /* proj */
 
-function proj(location) {
+function proj (location) {
     // Class to handle simple project xml operations
     if (!location) {
         throw new Error('Project file location can\'t be null or empty');
@@ -548,24 +544,23 @@ proj.prototype = {
     }
 };
 
-
 /* jsproj */
 
-function jsproj(location) {
-    function targetPlatformIdentifierToDevice(jsprojPlatform) {
-        var index = ["Windows", "WindowsPhoneApp", "UAP"].indexOf(jsprojPlatform);
+function jsproj (location) {
+    function targetPlatformIdentifierToDevice (jsprojPlatform) {
+        var index = ['Windows', 'WindowsPhoneApp', 'UAP'].indexOf(jsprojPlatform);
         if (index < 0) {
             throw new Error("Unknown TargetPlatformIdentifier '" + jsprojPlatform + "' in project file '" + location + "'");
         }
-        return ["windows", "phone", "windows"][index];
+        return ['windows', 'phone', 'windows'][index];
     }
 
-    function validateVersion(version) {
+    function validateVersion (version) {
         version = version.split('.');
         while (version.length < 3) {
-            version.push("0");
+            version.push('0');
         }
-        return version.join(".");
+        return version.join('.');
     }
 
     // Class to handle a jsproj file
@@ -608,13 +603,13 @@ jsproj.prototype.getSemVersion = function () {
 
 /* Common support functions */
 
-function createConditionAttrib(targetConditions) {
+function createConditionAttrib (targetConditions) {
     var arch = targetConditions.arch;
     if (arch) {
-        if (arch === "arm") {
+        if (arch === 'arm') {
             // Specifcally allow "arm" as alternative to "ARM"
-            arch = "ARM";
-        } else if (arch !== "x86" && arch !== "x64" && arch !== "ARM") {
+            arch = 'ARM';
+        } else if (arch !== 'x86' && arch !== 'x64' && arch !== 'ARM') {
             throw new Error('Invalid arch attribute (must be "x86", "x64" or "ARM"): ' + arch);
         }
         return "'$(Platform)'=='" + arch + "'";
@@ -622,5 +617,4 @@ function createConditionAttrib(targetConditions) {
     return null;
 }
 
-
 module.exports = jsprojManager;

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/MRTImage.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/MRTImage.js b/template/cordova/lib/MRTImage.js
index 822ece9..b557e22 100644
--- a/template/cordova/lib/MRTImage.js
+++ b/template/cordova/lib/MRTImage.js
@@ -19,7 +19,7 @@
 
 var path = require('path');
 
-function MRTImage(filePath) {
+function MRTImage (filePath) {
     this.path = filePath;
     this.location = path.dirname(filePath);
     this.extension = path.extname(filePath);

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/MSBuildTools.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/MSBuildTools.js b/template/cordova/lib/MSBuildTools.js
index 6da98c8..8bc92e6 100644
--- a/template/cordova/lib/MSBuildTools.js
+++ b/template/cordova/lib/MSBuildTools.js
@@ -17,8 +17,8 @@
        under the License.
 */
 
-var Q     = require('q');
-var path  = require('path');
+var Q = require('q');
+var path = require('path');
 var shell = require('shelljs');
 var Version = require('./Version');
 var events = require('cordova-common').events;
@@ -29,7 +29,7 @@ function MSBuildTools (version, path) {
     this.path = path;
 }
 
-MSBuildTools.prototype.buildProject = function(projFile, buildType, buildarch, buildFlags) {
+MSBuildTools.prototype.buildProject = function (projFile, buildType, buildarch, buildFlags) {
     events.emit('log', 'Building project: ' + projFile);
     events.emit('log', '\tConfiguration : ' + buildType);
     events.emit('log', '\tPlatform      : ' + buildarch);
@@ -43,8 +43,8 @@ MSBuildTools.prototype.buildProject = function(projFile, buildType, buildarch, b
     };
 
     var args = ['/clp:NoSummary;NoItemAndPropertyList;Verbosity=minimal', '/nologo',
-    '/p:Configuration=' + buildType,
-    '/p:Platform=' + buildarch];
+        '/p:Configuration=' + buildType,
+        '/p:Platform=' + buildarch];
 
     if (buildFlags) {
         args = args.concat(buildFlags);
@@ -56,11 +56,9 @@ MSBuildTools.prototype.buildProject = function(projFile, buildType, buildarch, b
     // Check if SDK required to build the respective platform is present. If not present, return with corresponding error, else call msbuild.
     if (projFile.indexOf('CordovaApp.Phone.jsproj') > -1) {
         promise = checkPhoneSDK();
-    }
-    else if (projFile.indexOf('CordovaApp.Windows.jsproj') > -1) {
+    } else if (projFile.indexOf('CordovaApp.Windows.jsproj') > -1) {
         promise = checkWinSDK('8.1');
-    }
-    else {
+    } else {
         promise = checkWinSDK('10.0');
     }
 
@@ -81,12 +79,12 @@ module.exports.findAvailableVersion = function () {
     });
 };
 
-function findAllAvailableVersionsFallBack() {
+function findAllAvailableVersionsFallBack () {
     var versions = ['15.0', '14.0', '12.0', '4.0'];
     events.emit('verbose', 'Searching for available MSBuild versions...');
 
-    return Q.all(versions.map(checkMSBuildVersion)).then(function(unprocessedResults) {
-        return unprocessedResults.filter(function(item) {
+    return Q.all(versions.map(checkMSBuildVersion)).then(function (unprocessedResults) {
+        return unprocessedResults.filter(function (item) {
             return !!item;
         });
     });
@@ -99,9 +97,9 @@ module.exports.findAllAvailableVersions = function () {
     if (process.env.VSINSTALLDIR) {
         var msBuildPath = path.join(process.env.VSINSTALLDIR, 'MSBuild/15.0/Bin');
         return module.exports.getMSBuildToolsAt(msBuildPath)
-        .then(function (msBuildTools) {
-            return [msBuildTools];
-        }).catch(findAllAvailableVersionsFallBack);
+            .then(function (msBuildTools) {
+                return [msBuildTools];
+            }).catch(findAllAvailableVersionsFallBack);
     }
 
     return findAllAvailableVersionsFallBack();
@@ -118,38 +116,37 @@ module.exports.getMSBuildToolsAt = function (location) {
 
     // TODO: can we account on these params availability and printed version format?
     return spawn(msbuildExe, ['-version', '-nologo'])
-    .then(function (output) {
-        // MSBuild prints its' version as 14.0.25123.0, so we pick only first 2 segments
-        var version = output.match(/^(\d+\.\d+)/)[1];
-        return new MSBuildTools(version, location);
-    });
+        .then(function (output) {
+            // MSBuild prints its' version as 14.0.25123.0, so we pick only first 2 segments
+            var version = output.match(/^(\d+\.\d+)/)[1];
+            return new MSBuildTools(version, location);
+        });
 };
 
-function checkMSBuildVersion(version) {
+function checkMSBuildVersion (version) {
     return spawn('reg', ['query', 'HKLM\\SOFTWARE\\Microsoft\\MSBuild\\ToolsVersions\\' + version, '/v', 'MSBuildToolsPath'])
-    .then(function(output) {
-        // fetch msbuild path from 'reg' output
-        var toolsPath = /MSBuildToolsPath\s+REG_SZ\s+(.*)/i.exec(output);
-        if (toolsPath) {
-            toolsPath = toolsPath[1];
-            // CB-9565: Windows 10 invokes .NET Native compiler, which only runs on x86 arch,
-            // so if we're running an x64 Node, make sure to use x86 tools.
-            if ((version === '15.0' || version === '14.0') && toolsPath.indexOf('amd64') > -1) {
-                toolsPath = path.resolve(toolsPath, '..');
+        .then(function (output) {
+            // fetch msbuild path from 'reg' output
+            var toolsPath = /MSBuildToolsPath\s+REG_SZ\s+(.*)/i.exec(output);
+            if (toolsPath) {
+                toolsPath = toolsPath[1];
+                // CB-9565: Windows 10 invokes .NET Native compiler, which only runs on x86 arch,
+                // so if we're running an x64 Node, make sure to use x86 tools.
+                if ((version === '15.0' || version === '14.0') && toolsPath.indexOf('amd64') > -1) {
+                    toolsPath = path.resolve(toolsPath, '..');
+                }
+                events.emit('verbose', 'Found MSBuild v' + version + ' at ' + toolsPath);
+                return new MSBuildTools(version, toolsPath);
             }
-            events.emit('verbose', 'Found MSBuild v' + version + ' at ' + toolsPath);
-            return new MSBuildTools(version, toolsPath);
-        }
-    })
-    .catch(function (err) {
-        // if 'reg' exits with error, assume that registry key not found
-        return;
-    });
+        }).catch(function (err) { /* eslint handle-callback-err : 0 */
+            // if 'reg' exits with error, assume that registry key not found
+
+        });
 }
 
 /// returns an array of available UAP Versions
-function getAvailableUAPVersions() {
-    /*jshint -W069 */
+function getAvailableUAPVersions () {
+    /* jshint -W069 */
     var programFilesFolder = process.env['ProgramFiles(x86)'] || process.env['ProgramFiles'];
     // No Program Files folder found, so we won't be able to find UAP SDK
     if (!programFilesFolder) return [];
@@ -160,11 +157,11 @@ function getAvailableUAPVersions() {
     }
 
     var result = [];
-    shell.ls(uapFolderPath).filter(function(uapDir) {
+    shell.ls(uapFolderPath).filter(function (uapDir) {
         return shell.test('-d', path.join(uapFolderPath, uapDir));
-    }).map(function(folder) {
+    }).map(function (folder) {
         return Version.tryParse(folder);
-    }).forEach(function(version, index) {
+    }).forEach(function (version, index) {
         if (version) {
             result.push(version);
         }

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/PluginHandler.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/PluginHandler.js b/template/cordova/lib/PluginHandler.js
index c264f20..f393528 100644
--- a/template/cordova/lib/PluginHandler.js
+++ b/template/cordova/lib/PluginHandler.js
@@ -19,7 +19,7 @@
 
 /* jshint sub:true */
 
-var fs   = require('fs');
+var fs = require('fs');
 var path = require('path');
 var shell = require('shelljs');
 var events = require('cordova-common').events;
@@ -27,14 +27,14 @@ var CordovaError = require('cordova-common').CordovaError;
 
 // returns relative file path for a file in the plugin's folder that can be referenced
 // from a project file.
-function getPluginFilePath(plugin, pluginFile, targetDir) {
+function getPluginFilePath (plugin, pluginFile, targetDir) {
     var src = path.resolve(plugin.dir, pluginFile);
     return '$(ProjectDir)' + path.relative(targetDir, src);
 }
 
 var handlers = {
     'source-file': {
-        install:function(obj, plugin, project, options) {
+        install: function (obj, plugin, project, options) {
             var dest = path.join('plugins', plugin.id, obj.targetDir || '', path.basename(obj.src));
             if (options && options.force) {
                 copyFile(plugin.dir, obj.src, project.root, dest);
@@ -44,15 +44,15 @@ var handlers = {
             // add reference to this file to jsproj.
             project.addSourceFile(dest);
         },
-        uninstall:function(obj, plugin, project, options) {
+        uninstall: function (obj, plugin, project, options) {
             var dest = path.join('plugins', plugin.id, obj.targetDir || '', path.basename(obj.src));
             removeFile(project.root, dest);
             // remove reference to this file from csproj.
             project.removeSourceFile(dest);
         }
     },
-    'resource-file':{
-        install:function(obj, plugin, project, options) {
+    'resource-file': {
+        install: function (obj, plugin, project, options) {
             if (obj.reference) {
                 // do not copy, but reference the file in the plugin folder. This allows to
                 // have multiple source files map to the same target and select the appropriate
@@ -75,7 +75,7 @@ var handlers = {
                 project.addResourceFileToProject(obj.target, obj.target, getTargetConditions(obj));
             }
         },
-        uninstall:function(obj, plugin, project, options) {
+        uninstall: function (obj, plugin, project, options) {
             if (obj.reference) {
                 var relativeSrcPath = getPluginFilePath(plugin, obj.src, project.projectFolder);
                 project.removeResourceFileFromProject(relativeSrcPath, getTargetConditions(obj));
@@ -86,18 +86,18 @@ var handlers = {
         }
     },
     'lib-file': {
-        install:function(obj, plugin, project, options) {
-            var inc  = obj.Include || obj.src;
+        install: function (obj, plugin, project, options) {
+            var inc = obj.Include || obj.src;
             project.addSDKRef(inc, getTargetConditions(obj));
         },
-        uninstall:function(obj, plugin, project, options) {
+        uninstall: function (obj, plugin, project, options) {
             events.emit('verbose', 'windows lib-file uninstall :: ' + plugin.id);
             var inc = obj.Include || obj.src;
             project.removeSDKRef(inc, getTargetConditions(obj));
         }
     },
     'framework': {
-        install:function(obj, plugin, project, options) {
+        install: function (obj, plugin, project, options) {
             events.emit('verbose', 'windows framework install :: ' + plugin.id);
 
             var src = obj.src;
@@ -106,7 +106,7 @@ var handlers = {
             var targetDir = obj.targetDir || '';
             var implementPath = obj.implementation;
 
-            if(type === 'projectReference') {
+            if (type === 'projectReference') {
                 dest = path.join(path.relative(project.projectFolder, plugin.dir), targetDir, src);
                 project.addProjectReference(dest, getTargetConditions(obj));
             } else {
@@ -120,24 +120,23 @@ var handlers = {
             }
 
         },
-        uninstall:function(obj, plugin, project, options) {
-            events.emit('verbose', 'windows framework uninstall :: ' + plugin.id  );
+        uninstall: function (obj, plugin, project, options) {
+            events.emit('verbose', 'windows framework uninstall :: ' + plugin.id);
 
             var src = obj.src;
             var type = obj.type;
 
-            if(type === 'projectReference') {
+            if (type === 'projectReference') {
                 project.removeProjectReference(path.join(path.relative(project.projectFolder, plugin.dir), src), getTargetConditions(obj));
-            }
-            else {
+            } else {
                 var targetPath = path.join('plugins', plugin.id);
                 removeFile(project.root, targetPath);
                 project.removeReference(src, getTargetConditions(obj));
             }
         }
     },
-    asset:{
-        install:function(obj, plugin, project, options) {
+    asset: {
+        install: function (obj, plugin, project, options) {
             if (!obj.src) {
                 throw new CordovaError(generateAttributeError('src', 'asset', plugin.id));
             }
@@ -148,7 +147,7 @@ var handlers = {
             copyFile(plugin.dir, obj.src, project.www, obj.target);
             if (options && options.usePlatformWww) copyFile(plugin.dir, obj.src, project.platformWww, obj.target);
         },
-        uninstall:function(obj, plugin, project, options) {
+        uninstall: function (obj, plugin, project, options) {
             var target = obj.target || obj.src;
 
             if (!target) throw new CordovaError(generateAttributeError('target', 'asset', plugin.id));
@@ -165,7 +164,7 @@ var handlers = {
         install: function (obj, plugin, project, options) {
             // Copy the plugin's files into the www directory.
             var moduleSource = path.resolve(plugin.dir, obj.src);
-            var moduleName = plugin.id + '.' + (obj.name || path.basename(obj.src, path.extname (obj.src)));
+            var moduleName = plugin.id + '.' + (obj.name || path.basename(obj.src, path.extname(obj.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
@@ -201,7 +200,7 @@ module.exports.getInstaller = function (type) {
     events.emit('verbose', '<' + type + '> is not supported for Windows plugins');
 };
 
-module.exports.getUninstaller = function(type) {
+module.exports.getUninstaller = function (type) {
     if (handlers[type] && handlers[type].uninstall) {
         return handlers[type].uninstall;
     }
@@ -209,7 +208,7 @@ module.exports.getUninstaller = function(type) {
     events.emit('verbose', '<' + type + '> is not supported for Windows plugins');
 };
 
-function getTargetConditions(obj) {
+function getTargetConditions (obj) {
     return { versions: obj.versions, deviceTarget: obj.deviceTarget, arch: obj.arch };
 }
 
@@ -220,14 +219,12 @@ function copyFile (plugin_dir, src, project_dir, dest, link) {
     // 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 CordovaError('File "' + src + '" is located outside the plugin directory "' + plugin_dir + '"');
+    if (real_path.indexOf(real_plugin_path) !== 0) { throw new CordovaError('File "' + src + '" is located outside the plugin directory "' + plugin_dir + '"'); }
 
     dest = path.resolve(project_dir, dest);
 
     // check that dest path is located in project directory
-    if (dest.indexOf(path.resolve(project_dir)) !== 0)
-        throw new CordovaError('Destination "' + dest + '" for source file "' + src + '" is located outside the project');
+    if (dest.indexOf(path.resolve(project_dir)) !== 0) { throw new CordovaError('Destination "' + dest + '" for source file "' + src + '" is located outside the project'); }
 
     shell.mkdir('-p', path.dirname(dest));
 
@@ -235,7 +232,7 @@ function copyFile (plugin_dir, src, project_dir, dest, link) {
         fs.symlinkSync(path.relative(path.dirname(dest), 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);
     }
@@ -244,8 +241,7 @@ function copyFile (plugin_dir, src, project_dir, dest, link) {
 // Same as copy file but throws error if target exists
 function copyNewFile (plugin_dir, src, project_dir, dest, link) {
     var target_path = path.resolve(project_dir, dest);
-    if (fs.existsSync(target_path))
-        throw new CordovaError('"' + target_path + '" already exists!');
+    if (fs.existsSync(target_path)) { throw new CordovaError('"' + target_path + '" already exists!'); }
 
     copyFile(plugin_dir, src, project_dir, dest, !!link);
 }
@@ -266,8 +262,8 @@ function removeFileAndParents (baseDir, destFile, stopper) {
     // 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 {
@@ -277,6 +273,6 @@ function removeFileAndParents (baseDir, destFile, stopper) {
     }
 }
 
-function generateAttributeError(attribute, element, id) {
+function generateAttributeError (attribute, element, id) {
     return 'Required attribute "' + attribute + '" not specified in <' + element + '> element from plugin: ' + id;
 }

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/PluginInfo.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/PluginInfo.js b/template/cordova/lib/PluginInfo.js
index 78c9593..723fa26 100644
--- a/template/cordova/lib/PluginInfo.js
+++ b/template/cordova/lib/PluginInfo.js
@@ -38,8 +38,8 @@ var MANIFESTS = {
 var SUBSTS = ['package.phone.appxmanifest', 'package.windows.appxmanifest', 'package.windows10.appxmanifest'];
 var TARGETS = ['windows', 'phone', 'all'];
 
-function processChanges(changes) {
-    var hasManifestChanges  = changes.some(function(change) {
+function processChanges (changes) {
+    var hasManifestChanges = changes.some(function (change) {
         return change.target === 'package.appxmanifest';
     });
 
@@ -52,7 +52,7 @@ function processChanges(changes) {
     var oldChanges = changes;
     changes = [];
 
-    oldChanges.forEach(function(change) {
+    oldChanges.forEach(function (change) {
         // Only support semver/device-target demux for package.appxmanifest
         // Pass through in case something downstream wants to use it
         if (change.target !== 'package.appxmanifest') {
@@ -67,13 +67,13 @@ function processChanges(changes) {
     return changes;
 }
 
-function demuxChangeWithSubsts(change, manifestFiles) {
-    return manifestFiles.map(function(file) {
-         return createReplacement(file, change);
+function demuxChangeWithSubsts (change, manifestFiles) {
+    return manifestFiles.map(function (file) {
+        return createReplacement(file, change);
     });
 }
 
-function getManifestsForChange(change) {
+function getManifestsForChange (change) {
     var hasTarget = (typeof change.deviceTarget !== 'undefined');
     var hasVersion = (typeof change.versions !== 'undefined');
 
@@ -90,7 +90,7 @@ function getManifestsForChange(change) {
     }
 
     var knownWindowsVersionsForTargetDeviceSet = Object.keys(MANIFESTS[targetDeviceSet]);
-    return knownWindowsVersionsForTargetDeviceSet.reduce(function(manifestFiles, winver) {
+    return knownWindowsVersionsForTargetDeviceSet.reduce(function (manifestFiles, winver) {
         if (hasVersion && !semver.satisfies(winver, change.versions)) {
             return manifestFiles;
         }
@@ -100,37 +100,36 @@ function getManifestsForChange(change) {
 
 // This is a local function that creates the new replacement representing the
 // mutation.  Used to save code further down.
-function createReplacement(manifestFile, originalChange) {
+function createReplacement (manifestFile, originalChange) {
     var replacement = {
-        target:         manifestFile,
-        parent:         originalChange.parent,
-        after:          originalChange.after,
-        xmls:           originalChange.xmls,
-        versions:       originalChange.versions,
-        deviceTarget:   originalChange.deviceTarget
+        target: manifestFile,
+        parent: originalChange.parent,
+        after: originalChange.after,
+        xmls: originalChange.xmls,
+        versions: originalChange.versions,
+        deviceTarget: originalChange.deviceTarget
     };
     return replacement;
 }
 
-
 /*
 A class for holidng the information currently stored in plugin.xml
 It's inherited from cordova-common's PluginInfo class
 In addition it overrides getConfigFiles, getEditConfigs, getFrameworks methods to use windows-specific logic
  */
-function PluginInfo(dirname) {
+function PluginInfo (dirname) {
     //  We're not using `util.inherit' because original PluginInfo defines
     //  its' methods inside of constructor
     CommonPluginInfo.apply(this, arguments);
     var parentGetConfigFiles = this.getConfigFiles;
     var parentGetEditConfigs = this.getEditConfigs;
 
-    this.getEditConfigs = function(platform) {
+    this.getEditConfigs = function (platform) {
         var editConfigs = parentGetEditConfigs(platform);
         return processChanges(editConfigs);
     };
 
-    this.getConfigFiles = function(platform) {
+    this.getConfigFiles = function (platform) {
         var configFiles = parentGetConfigFiles(platform);
         return processChanges(configFiles);
     };

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/Version.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/Version.js b/template/cordova/lib/Version.js
index d57b53c..fb56067 100644
--- a/template/cordova/lib/Version.js
+++ b/template/cordova/lib/Version.js
@@ -17,32 +17,30 @@
        under the License.
 */
 
-function Version(major, minor, build, qfe) {
+function Version (major, minor, build, qfe) {
     this.major = major;
     this.minor = zeroIfUndefined(minor);
     this.build = zeroIfUndefined(build);
-    this.qfe   = zeroIfUndefined(qfe);
+    this.qfe = zeroIfUndefined(qfe);
 }
 
-function zeroIfUndefined(val) {
-    if (typeof val === 'undefined')
-        return 0;
+function zeroIfUndefined (val) {
+    if (typeof val === 'undefined') { return 0; }
 
     return val;
 }
 
 Version.Expression = /^\d{1,8}(\.\d{1,8}){0,3}$/;
-Version.fromString = function(str) {
+Version.fromString = function (str) {
     var result = Version.tryParse(str);
-    if (!result)
-        throw new RangeError('Could not parse a version from the provided value "' + str + '".');
+    if (!result) { throw new RangeError('Could not parse a version from the provided value "' + str + '".'); }
 
     return result;
 };
 
-Version.tryParse = function(str) {
+Version.tryParse = function (str) {
     if (Version.Expression.test(str)) {
-        var parts = str.split('.').map(function(part) {
+        var parts = str.split('.').map(function (part) {
             return parseInt(part, 10);
         });
 
@@ -53,21 +51,16 @@ Version.tryParse = function(str) {
     return false;
 };
 
-Version.comparer = function(a, b) {
-    if (a.constructor !== Version || b.constructor !== Version) 
-        throw new TypeError('Must compare only Versions');
+Version.comparer = function (a, b) {
+    if (a.constructor !== Version || b.constructor !== Version) { throw new TypeError('Must compare only Versions'); }
 
-    if (a.gt(b))
-        return 1;
-    else if (a.eq(b))
-        return 0;
+    if (a.gt(b)) { return 1; } else if (a.eq(b)) { return 0; }
 
     return -1;
 };
 
-Version.prototype.gt = function(other) {
-    if (other.constructor !== Version)
-        throw new TypeError('other is not a Version.');
+Version.prototype.gt = function (other) {
+    if (other.constructor !== Version) { throw new TypeError('other is not a Version.'); }
 
     if (this.major > other.major) return true;
     if (this.major < other.major) return false;
@@ -81,9 +74,8 @@ Version.prototype.gt = function(other) {
     return false;
 };
 
-Version.prototype.gte = function(other) {
-    if (other.constructor !== Version)
-        throw new TypeError('other is not a Version.');
+Version.prototype.gte = function (other) {
+    if (other.constructor !== Version) { throw new TypeError('other is not a Version.'); }
 
     if (this.major > other.major) return true;
     if (this.major < other.major) return false;
@@ -97,17 +89,15 @@ Version.prototype.gte = function(other) {
     return true;
 };
 
-Version.prototype.eq = function(other) {
-    if (other.constructor !== Version)
-        throw new TypeError('other is not a Version.');
+Version.prototype.eq = function (other) {
+    if (other.constructor !== Version) { throw new TypeError('other is not a Version.'); }
 
-    if (this.major === other.major && this.minor === other.minor && this.build === other.build && this.qfe === other.qfe)
-        return true;
+    if (this.major === other.major && this.minor === other.minor && this.build === other.build && this.qfe === other.qfe) { return true; }
 
     return false;
 };
 
-Version.prototype.toString = function() {
+Version.prototype.toString = function () {
     return this.major + '.' + this.minor + '.' + this.build + '.' + this.qfe;
 };
 

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/build.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/build.js b/template/cordova/lib/build.js
index b9bbfeb..5a2934d 100644
--- a/template/cordova/lib/build.js
+++ b/template/cordova/lib/build.js
@@ -17,13 +17,13 @@
        under the License.
 */
 
-var Q     = require('q');
-var path  = require('path');
-var nopt  = require('nopt');
+var Q = require('q');
+var path = require('path');
+var nopt = require('nopt');
 var shell = require('shelljs');
 var utils = require('./utils');
 var prepare = require('./prepare');
-var package = require('./package');
+var pckage = require('./package');
 var Version = require('./Version');
 var MSBuildTools = require('./MSBuildTools');
 var AppxManifest = require('./AppxManifest');
@@ -52,45 +52,44 @@ module.exports.run = function run (buildOptions) {
 
     ROOT = this.root || ROOT;
 
-    if (!utils.isCordovaProject(this.root)){
+    if (!utils.isCordovaProject(this.root)) {
         return Q.reject(new CordovaError('Could not find project at ' + this.root));
     }
 
     var buildConfig = parseAndValidateArgs(buildOptions);
 
     return MSBuildTools.findAllAvailableVersions()
-    .then(function(msbuildTools) {
-        // Apply build related configs
-        prepare.updateBuildConfig(buildConfig);
+        .then(function (msbuildTools) {
+            // Apply build related configs
+            prepare.updateBuildConfig(buildConfig);
 
-        if (buildConfig.publisherId) {
-            updateManifestWithPublisher(msbuildTools, buildConfig);
-        }
+            if (buildConfig.publisherId) {
+                updateManifestWithPublisher(msbuildTools, buildConfig);
+            }
 
-        cleanIntermediates();
-        return buildTargets(msbuildTools, buildConfig);
-    })
-    .then(function(pkg) {
-        events.emit('verbose', ' BUILD OUTPUT: ' + pkg.appx);
-        return pkg;
-    });
+            cleanIntermediates();
+            return buildTargets(msbuildTools, buildConfig);
+        }).then(function (pkg) {
+            events.emit('verbose', ' BUILD OUTPUT: ' + pkg.appx);
+            return pkg;
+        });
 };
 
 // returns list of projects to be built based on config.xml and additional parameters (-appx)
-module.exports.getBuildTargets  = function(isWinSwitch, isPhoneSwitch, projOverride) {
+module.exports.getBuildTargets = function (isWinSwitch, isPhoneSwitch, projOverride) {
 
     // apply build target override if one was specified
     if (projOverride) {
         switch (projOverride.toLowerCase()) {
-            case '8.1-phone':
-                return [projFiles.phone];
-            case '8.1-win':
-                return [projFiles.win];
-            case 'uap':
-                return [projFiles.win10];
-            default:
-                events.emit('warn', 'Ignoring unrecognized --appx parameter passed to build: "' + projOverride + '"');
-                break;
+        case '8.1-phone':
+            return [projFiles.phone];
+        case '8.1-win':
+            return [projFiles.win];
+        case 'uap':
+            return [projFiles.win10];
+        default:
+            events.emit('warn', 'Ignoring unrecognized --appx parameter passed to build: "' + projOverride + '"');
+            break;
         }
     }
 
@@ -101,40 +100,40 @@ module.exports.getBuildTargets  = function(isWinSwitch, isPhoneSwitch, projOverr
     // Windows
     if (isWinSwitch || noSwitches) { // if --win or no arg
         var windowsTargetVersion = configXML.getWindowsTargetVersion();
-        switch(windowsTargetVersion.toLowerCase()) {
-            case '8':
-            case '8.0':
-                throw new CordovaError('windows8 platform is deprecated. To use windows-target-version=8.0 you must downgrade to cordova-windows@4.');
-            case '8.1':
-                targets.push(projFiles.win);
-                break;
-            case '10.0':
-            case 'uap':
-                targets.push(projFiles.win10);
-                break;
-            default:
-                throw new CordovaError('Unsupported windows-target-version value: ' + windowsTargetVersion);
+        switch (windowsTargetVersion.toLowerCase()) {
+        case '8':
+        case '8.0':
+            throw new CordovaError('windows8 platform is deprecated. To use windows-target-version=8.0 you must downgrade to cordova-windows@4.');
+        case '8.1':
+            targets.push(projFiles.win);
+            break;
+        case '10.0':
+        case 'uap':
+            targets.push(projFiles.win10);
+            break;
+        default:
+            throw new CordovaError('Unsupported windows-target-version value: ' + windowsTargetVersion);
         }
     }
 
     // Windows Phone
     if (isPhoneSwitch || noSwitches) { // if --phone or no arg
         var windowsPhoneTargetVersion = configXML.getWindowsPhoneTargetVersion();
-        switch(windowsPhoneTargetVersion.toLowerCase()) {
-            case '8.1':
-                targets.push(projFiles.phone);
-                break;
-            case '10.0':
-            case 'uap':
-                if (targets.indexOf(projFiles.win10) < 0) {
-                    // Already built due to --win or no switches
-                    // and since the same thing can be run on Phone as Windows,
-                    // we can skip this one.
-                    targets.push(projFiles.win10);
-                }
-                break;
-            default:
-                throw new Error('Unsupported windows-phone-target-version value: ' + windowsPhoneTargetVersion);
+        switch (windowsPhoneTargetVersion.toLowerCase()) {
+        case '8.1':
+            targets.push(projFiles.phone);
+            break;
+        case '10.0':
+        case 'uap':
+            if (targets.indexOf(projFiles.win10) < 0) {
+                // Already built due to --win or no switches
+                // and since the same thing can be run on Phone as Windows,
+                // we can skip this one.
+                targets.push(projFiles.win10);
+            }
+            break;
+        default:
+            throw new Error('Unsupported windows-phone-target-version value: ' + windowsPhoneTargetVersion);
         }
     }
 
@@ -150,7 +149,7 @@ module.exports.getBuildTargets  = function(isWinSwitch, isPhoneSwitch, projOverr
  *
  * @return  {Object}             Build configuration, used by other methods
  */
-function parseAndValidateArgs(options) {
+function parseAndValidateArgs (options) {
     // parse and validate args
     var args = nopt({
         'archs': [String],
@@ -183,8 +182,8 @@ function parseAndValidateArgs(options) {
     var archs = options.archs || args.archs;
     config.buildArchs = archs ? archs.toLowerCase().split(' ') : ['anycpu'];
 
-    config.phone = args.phone ? true : false;
-    config.win = args.win ? true : false;
+    config.phone = !!args.phone;
+    config.win = !!args.win;
     config.projVerOverride = args.appx;
     // only set config.bundle if architecture is not anycpu
     if (args.bundle) {
@@ -220,17 +219,17 @@ function parseAndValidateArgs(options) {
     return config;
 }
 
-function parseBuildConfig(buildConfigPath, buildType) {
-    var buildConfig, result = {};
-    events.emit('verbose', 'Reading build config file: '+ buildConfigPath);
+function parseBuildConfig (buildConfigPath, buildType) {
+    var buildConfig;
+    var result = {};
+    events.emit('verbose', 'Reading build config file: ' + buildConfigPath);
     try {
         var contents = fs.readFileSync(buildConfigPath, 'utf8');
         buildConfig = JSON.parse(contents.replace(/^\ufeff/, '')); // Remove BOM
     } catch (e) {
         if (e.code === 'ENOENT') {
             throw new CordovaError('Specified build config file does not exist: ' + buildConfigPath);
-        }
-        else {
+        } else {
             throw e;
         }
     }
@@ -240,16 +239,16 @@ function parseBuildConfig(buildConfigPath, buildType) {
     var windowsInfo = buildConfig.windows[buildType];
 
     // If provided assume it's a relative path
-    if(windowsInfo.packageCertificateKeyFile) {
+    if (windowsInfo.packageCertificateKeyFile) {
         var buildPath = path.dirname(fs.realpathSync(buildConfigPath));
         result.packageCertificateKeyFile = path.resolve(buildPath, windowsInfo.packageCertificateKeyFile);
     }
 
-    if(windowsInfo.packageThumbprint) {
+    if (windowsInfo.packageThumbprint) {
         result.packageThumbprint = windowsInfo.packageThumbprint;
     }
 
-    if(windowsInfo.publisherId) {
+    if (windowsInfo.publisherId) {
         // Quickly validate publisherId
         var publisherRegexStr = '(CN|L|O|OU|E|C|S|STREET|T|G|I|SN|DC|SERIALNUMBER|(OID\\.(0|[1-9][0-9]*)(\\.(0|[1-9][0-9]*))+))=' +
                                 '(([^,+="<>#;])+|".*")(, (' +
@@ -274,23 +273,23 @@ function parseBuildConfig(buildConfigPath, buildType) {
 
 // Note: This function is very narrow and only writes to the app manifest if an update is done.  See CB-9450 for the
 // reasoning of why this is the case.
-function updateManifestWithPublisher(allMsBuildVersions, config) {
+function updateManifestWithPublisher (allMsBuildVersions, config) {
     if (!config.publisherId) return;
 
     var selectedBuildTargets = getBuildTargets(config);
     var msbuild = getLatestMSBuild(allMsBuildVersions);
     var myBuildTargets = filterSupportedTargets(selectedBuildTargets, msbuild);
-    var manifestFiles = myBuildTargets.map(function(proj) {
+    var manifestFiles = myBuildTargets.map(function (proj) {
         return projFilesToManifests[proj];
     });
-    manifestFiles.forEach(function(file) {
+    manifestFiles.forEach(function (file) {
         var manifest = AppxManifest.get(path.join(ROOT, file));
         manifest.getIdentity().setPublisher(config.publisherId);
         manifest.write();
     });
 }
 
-function buildTargets(allMsBuildVersions, config) {
+function buildTargets (allMsBuildVersions, config) {
     // filter targets to make sure they are supported on this development machine
     var selectedBuildTargets = getBuildTargets(config);
     var msbuild = getLatestMSBuild(allMsBuildVersions);
@@ -306,10 +305,10 @@ function buildTargets(allMsBuildVersions, config) {
     var shouldBundle = !!config.bundle;
 
     // collect all build configurations (pairs of project to build and target architecture)
-    myBuildTargets.forEach(function(buildTarget) {
-        config.buildArchs.forEach(function(buildArch) {
+    myBuildTargets.forEach(function (buildTarget) {
+        config.buildArchs.forEach(function (buildArch) {
             buildConfigs.push({
-                target:buildTarget,
+                target: buildTarget,
                 arch: buildArch
             });
 
@@ -329,9 +328,9 @@ function buildTargets(allMsBuildVersions, config) {
 
     // run builds serially
     var buildsCompleted = buildConfigs.reduce(function (promise, build, index, configsArray) {
-         return promise.then(function () {
+        return promise.then(function () {
             // support for "any cpu" specified with or without space
-            if (build.arch == 'any cpu') {
+            if (build.arch === 'any cpu') {
                 build.arch = 'anycpu';
             }
 
@@ -354,31 +353,31 @@ function buildTargets(allMsBuildVersions, config) {
                 otherProperties.push('/p:UapAppxPackageBuildMode=StoreUpload');
             }
 
-            return msbuild.buildProject(path.join(ROOT, build.target), config.buildType,  build.arch, otherProperties);
-         });
+            return msbuild.buildProject(path.join(ROOT, build.target), config.buildType, build.arch, otherProperties);
+        });
     }, Q());
 
     if (shouldBundle) {
-        return buildsCompleted.then(function() {
+        return buildsCompleted.then(function () {
             return clearIntermediatesAndGetPackage(bundleTerms, config, hasAnyCpu);
         });
     } else {
-        return buildsCompleted.then(function() {
-            return package.getPackage(config.targetProject, config.buildType, config.buildArchs[0]);
+        return buildsCompleted.then(function () {
+            return pckage.getPackage(config.targetProject, config.buildType, config.buildArchs[0]);
         });
     }
 }
 
-function clearIntermediatesAndGetPackage(bundleTerms, config, hasAnyCpu) {
+function clearIntermediatesAndGetPackage (bundleTerms, config, hasAnyCpu) {
     // msbuild isn't capable of generating bundles unless you enable bundling for each individual arch
     // However, that generates intermediate bundles, like "CordovaApp.Windows10_0.0.1.0_x64.appxbundle"
     // We need to clear the intermediate bundles, or else "cordova run" will fail because of too
     // many .appxbundle files.
     events.emit('verbose', 'Clearing intermediates...');
     var appPackagesPath = path.join(ROOT, 'AppPackages');
-    var childDirectories = shell.ls(path.join(appPackagesPath, '*')).map(function(pathName) {
+    var childDirectories = shell.ls(path.join(appPackagesPath, '*')).map(function (pathName) {
         return { path: pathName, stats: fs.statSync(pathName) };
-    }).filter(function(fileInfo) {
+    }).filter(function (fileInfo) {
         return fileInfo.stats.isDirectory();
     });
 
@@ -387,7 +386,7 @@ function clearIntermediatesAndGetPackage(bundleTerms, config, hasAnyCpu) {
     }
 
     // find the most-recently-modified directory
-    childDirectories.sort(function(a, b) { return b.stats.mtime - a.stats.mtime; });
+    childDirectories.sort(function (a, b) { return b.stats.mtime - a.stats.mtime; });
     var outputDirectory = childDirectories[0];
 
     var finalFile = '';
@@ -396,23 +395,23 @@ function clearIntermediatesAndGetPackage(bundleTerms, config, hasAnyCpu) {
         archSearchString = 'AnyCPU' + (config.buildType === 'debug' ? '_debug' : '') + '.appxbundle';
     }
 
-    var filesToDelete = shell.ls(path.join(outputDirectory.path, '*.appx*')).filter(function(appxbundle) {
+    var filesToDelete = shell.ls(path.join(outputDirectory.path, '*.appx*')).filter(function (appxbundle) {
         var isMatch = appxbundle.indexOf(archSearchString) === -1;
         if (!isMatch) {
             finalFile = appxbundle;
         }
         return isMatch;
     });
-    filesToDelete.forEach(function(file) {
+    filesToDelete.forEach(function (file) {
         shell.rm(file);
     });
 
-    return package.getPackageFileInfo(finalFile);
+    return pckage.getPackageFileInfo(finalFile);
 }
 
 // Can update buildConfig in the following ways:
 //  * Sets targetProject property, the project to launch when complete
-function getBuildTargets(buildConfig) {
+function getBuildTargets (buildConfig) {
     var configXML = new ConfigParser(path.join(ROOT, 'config.xml'));
     var targets = [];
     var noSwitches = !(buildConfig.phone || buildConfig.win);
@@ -420,58 +419,58 @@ function getBuildTargets(buildConfig) {
     // Windows
     if (buildConfig.win || noSwitches) { // if --win or no arg
         var windowsTargetVersion = configXML.getWindowsTargetVersion();
-        switch(windowsTargetVersion) {
-            case '8':
-            case '8.0':
-                throw new CordovaError('windows8 platform is deprecated. To use windows-target-version=8.0 you must downgrade to cordova-windows@4.');
-            case '8.1':
-                targets.push(projFiles.win);
-                break;
-            case '10.0':
-            case 'UAP':
-                targets.push(projFiles.win10);
-                break;
-            default:
-                throw new Error('Unsupported windows-target-version value: ' + windowsTargetVersion);
+        switch (windowsTargetVersion) {
+        case '8':
+        case '8.0':
+            throw new CordovaError('windows8 platform is deprecated. To use windows-target-version=8.0 you must downgrade to cordova-windows@4.');
+        case '8.1':
+            targets.push(projFiles.win);
+            break;
+        case '10.0':
+        case 'UAP':
+            targets.push(projFiles.win10);
+            break;
+        default:
+            throw new Error('Unsupported windows-target-version value: ' + windowsTargetVersion);
         }
     }
 
     // Windows Phone
     if (buildConfig.phone || noSwitches) { // if --phone or no arg
         var windowsPhoneTargetVersion = configXML.getWindowsPhoneTargetVersion();
-        switch(windowsPhoneTargetVersion) {
-            case '8.1':
-                targets.push(projFiles.phone);
-                break;
-            case '10.0':
-            case 'UAP':
-                if (!buildConfig.win && !noSwitches) {
-                    // Already built due to --win or no switches
-                    // and since the same thing can be run on Phone as Windows,
-                    // we can skip this one.
-                    targets.push(projFiles.win10);
-                }
-                break;
-            default:
-                throw new Error('Unsupported windows-phone-target-version value: ' + windowsPhoneTargetVersion);
+        switch (windowsPhoneTargetVersion) {
+        case '8.1':
+            targets.push(projFiles.phone);
+            break;
+        case '10.0':
+        case 'UAP':
+            if (!buildConfig.win && !noSwitches) {
+                // Already built due to --win or no switches
+                // and since the same thing can be run on Phone as Windows,
+                // we can skip this one.
+                targets.push(projFiles.win10);
+            }
+            break;
+        default:
+            throw new Error('Unsupported windows-phone-target-version value: ' + windowsPhoneTargetVersion);
         }
     }
 
     // apply build target override if one was specified
     if (buildConfig.projVerOverride) {
         switch (buildConfig.projVerOverride) {
-            case '8.1-phone':
-                targets = [projFiles.phone];
-                break;
-            case '8.1-win':
-                targets = [projFiles.win];
-                break;
-            case 'uap':
-                targets = [projFiles.win10];
-                break;
-            default:
-                events.emit('warn', 'Ignoring unrecognized --appx parameter passed to build: "' + buildConfig.projVerOverride + '"');
-                break;
+        case '8.1-phone':
+            targets = [projFiles.phone];
+            break;
+        case '8.1-win':
+            targets = [projFiles.win];
+            break;
+        case 'uap':
+            targets = [projFiles.win10];
+            break;
+        default:
+            events.emit('warn', 'Ignoring unrecognized --appx parameter passed to build: "' + buildConfig.projVerOverride + '"');
+            break;
         }
     }
 
@@ -479,39 +478,38 @@ function getBuildTargets(buildConfig) {
     // as part of build configuration.  This will be used for determining the binary to 'run' after build is done.
     if (targets.length > 0) {
         switch (targets[0]) {
-            case projFiles.phone:
-                buildConfig.targetProject = 'phone';
-                break;
-            case projFiles.win10:
-                buildConfig.targetProject = 'windows10';
-                break;
-            case projFiles.win:
-                /* falls through */
-            default:
-                buildConfig.targetProject = 'windows';
-                break;
+        case projFiles.phone:
+            buildConfig.targetProject = 'phone';
+            break;
+        case projFiles.win10:
+            buildConfig.targetProject = 'windows10';
+            break;
+        case projFiles.win:
+            /* falls through */
+        default:
+            buildConfig.targetProject = 'windows';
+            break;
         }
     }
 
     return targets;
 }
 
-function getLatestMSBuild(allMsBuildVersions) {
+function getLatestMSBuild (allMsBuildVersions) {
     var availableVersions = allMsBuildVersions
-    .filter(function (buildTools) {
-        // Sanitize input - filter out tools w/ invalid versions
-        return Version.tryParse(buildTools.version);
-    })
-    .sort(function (a, b) {
-        // Sort tools list - use parsed Version objects for that
-        // to respect both major and minor versions segments
-        var parsedA = Version.fromString(a.version);
-        var parsedB = Version.fromString(b.version);
-
-        if (parsedA.gt(parsedB)) return -1;
-        if (parsedA.eq(parsedB)) return 0;
-        return 1;
-    });
+        .filter(function (buildTools) {
+            // Sanitize input - filter out tools w/ invalid versions
+            return Version.tryParse(buildTools.version);
+        }).sort(function (a, b) {
+            // Sort tools list - use parsed Version objects for that
+            // to respect both major and minor versions segments
+            var parsedA = Version.fromString(a.version);
+            var parsedB = Version.fromString(b.version);
+
+            if (parsedA.gt(parsedB)) return -1;
+            if (parsedA.eq(parsedB)) return 0;
+            return 1;
+        });
 
     if (availableVersions.length > 0) {
         // After sorting the first item will be the highest version available
@@ -522,15 +520,15 @@ function getLatestMSBuild(allMsBuildVersions) {
 // TODO: Fix this so that it outlines supported versions based on version criteria:
 // - v14: Windows 8.1, Windows 10
 // - v12: Windows 8.1
-function msBuild12TargetsFilter(target) {
+function msBuild12TargetsFilter (target) {
     return target === projFiles.win || target === projFiles.phone;
 }
 
-function msBuild14TargetsFilter(target) {
+function msBuild14TargetsFilter (target) {
     return target === projFiles.win || target === projFiles.phone || target === projFiles.win10;
 }
 
-function msBuild15TargetsFilter(target) {
+function msBuild15TargetsFilter (target) {
     return target === projFiles.win || target === projFiles.phone || target === projFiles.win10;
 }
 
@@ -567,7 +565,7 @@ function filterSupportedTargets (targets, msbuild) {
     return supportedTargets;
 }
 
-function cleanIntermediates() {
+function cleanIntermediates () {
     var buildPath = path.join(ROOT, 'build');
     if (shell.test('-e', buildPath)) {
         shell.rm('-rf', buildPath);
@@ -578,8 +576,8 @@ function cleanIntermediates() {
 module.exports.clean = function () {
     var projectPath = this.root;
     ['AppPackages', 'build']
-    .forEach(function(dir) {
-        shell.rm('-rf', path.join(projectPath, dir));
-    });
+        .forEach(function (dir) {
+            shell.rm('-rf', path.join(projectPath, dir));
+        });
     return Q.resolve();
 };

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/clean.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/clean.js b/template/cordova/lib/clean.js
index edd40de..12fa06d 100644
--- a/template/cordova/lib/clean.js
+++ b/template/cordova/lib/clean.js
@@ -17,17 +17,17 @@
        under the License.
 */
 
-var Q     = require('q'),
-    path  = require('path'),
-    shell = require('shelljs');
+var Q = require('q');
+var path = require('path');
+var shell = require('shelljs');
 
 var ROOT = path.join(__dirname, '..', '..');
 
 // cleans the project, removes AppPackages and build folders.
 module.exports.run = function (argv) {
     var projectPath = ROOT;
-    ['AppPackages', 'build'].forEach(function(dir) {
+    ['AppPackages', 'build'].forEach(function (dir) {
         shell.rm('-rf', path.join(projectPath, dir));
     });
     return Q.resolve();
-};
\ No newline at end of file
+};

http://git-wip-us.apache.org/repos/asf/cordova-windows/blob/a8692238/template/cordova/lib/deployment.js
----------------------------------------------------------------------
diff --git a/template/cordova/lib/deployment.js b/template/cordova/lib/deployment.js
index a728d11..0cb0194 100644
--- a/template/cordova/lib/deployment.js
+++ b/template/cordova/lib/deployment.js
@@ -17,35 +17,35 @@
        under the License.
 */
 
-/*jshint -W069 */
+/* jshint -W069 */
 
-var Q     = require('q'),
-    fs    = require('fs'),
-    path  = require('path');
+var Q = require('q');
+var fs = require('fs');
+var path = require('path');
 var spawn = require('cordova-common').superspawn.spawn;
 var events = require('cordova-common').events;
 
 var E_INVALIDARG = 2147942487;
 
-function DeploymentTool() {
+function DeploymentTool () {
 }
 
 /**
  * Determines whether the requested version of the deployment tool is available.
  * @returns True if the deployment tool can function; false if not.
  */
-DeploymentTool.prototype.isAvailable = function() {
+DeploymentTool.prototype.isAvailable = function () {
     return fs.existsSync(this.path);
 };
 
 /**
  * Enumerates devices attached to the development machine.
  * @returns A Promise for an array of objects, which should be passed into other functions to represent the device.
- * @remarks The returned objects contain 'index', 'name', and 'type' properties indicating basic information about them, 
- *    which is limited to the information provided by the system.  Other properties may also be included, but they are 
+ * @remarks The returned objects contain 'index', 'name', and 'type' properties indicating basic information about them,
+ *    which is limited to the information provided by the system.  Other properties may also be included, but they are
  *    specific to the deployment tool which created them and are likely used internally.
  */
-DeploymentTool.prototype.enumerateDevices = function() {
+DeploymentTool.prototype.enumerateDevices = function () {
     return Q.reject('May not use DeploymentTool directly, instead get an instance from DeploymentTool.getDeploymentTool()');
 };
 
@@ -58,7 +58,7 @@ DeploymentTool.prototype.enumerateDevices = function() {
  * @shouldUpdate Indicates whether to explicitly update the app, or install clean.
  * @pin Optionally provided if the device requires pairing for deployment.
  */
-DeploymentTool.prototype.installAppPackage = function(pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin) {
+DeploymentTool.prototype.installAppPackage = function (pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin) {
     return Q.reject('May not use DeploymentTool directly, instead get an instance from DeploymentTool.getDeploymentTool()');
 };
 
@@ -68,7 +68,7 @@ DeploymentTool.prototype.installAppPackage = function(pathToAppxPackage, targetD
  * @param packageInfo The app package name or Phone GUID representing the app.
  * @param targetDevice An object returned from a successful call to enumerateDevices.
  */
-DeploymentTool.prototype.uninstallAppPackage = function(packageInfo, targetDevice) {
+DeploymentTool.prototype.uninstallAppPackage = function (packageInfo, targetDevice) {
     return Q.reject('Unable to uninstall any app packages because that feature is not supported.');
 };
 
@@ -78,7 +78,7 @@ DeploymentTool.prototype.uninstallAppPackage = function(packageInfo, targetDevic
  * @param targetDevice {Object} An object returned from a successful call to enumerateDevices.
  * @returns A Promise for an array of app names.
  */
-DeploymentTool.prototype.getInstalledApps = function(targetDevice) {
+DeploymentTool.prototype.getInstalledApps = function (targetDevice) {
     return Q.reject('Unable to get installed apps because that feature is not supported.');
 };
 
@@ -88,19 +88,18 @@ DeploymentTool.prototype.getInstalledApps = function(targetDevice) {
  * @param targetDevice {Object} An object returned from a successful call to enumerateDevices.
  * @returns A Promise for when the app is launched.
  */
-DeploymentTool.prototype.launchApp = function(packageInfo, targetDevice) {
+DeploymentTool.prototype.launchApp = function (packageInfo, targetDevice) {
     return Q.reject('Unable to launch an app because that feature is not supported.');
 };
 
 /**
  * Gets a DeploymentTool to deploy to devices or emulators.
- * @param targetOsVersion {String} The version of the 
+ * @param targetOsVersion {String} The version of the
  */
-DeploymentTool.getDeploymentTool = function(targetOsVersion) {
+DeploymentTool.getDeploymentTool = function (targetOsVersion) {
     if (targetOsVersion === '8.1') {
         return new AppDeployCmdTool(targetOsVersion);
-    }
-    else {
+    } else {
         return new WinAppDeployCmdTool(targetOsVersion);
     }
 };
@@ -108,19 +107,18 @@ DeploymentTool.getDeploymentTool = function(targetOsVersion) {
 // DeviceInfo is an opaque object passed to install/uninstall.
 // Implementations of DeploymentTool can populate it with any additional
 //  information required for accessing them.
-function DeviceInfo(deviceIndex, deviceName, deviceType) {
+function DeviceInfo (deviceIndex, deviceName, deviceType) {
     this.index = deviceIndex;
     this.name = deviceName;
     this.type = deviceType;
 }
 
-DeviceInfo.prototype.toString = function() {
+DeviceInfo.prototype.toString = function () {
     return this.index + '. ' + this.name + ' (' + this.type + ')';
 };
 
-function AppDeployCmdTool(targetOsVersion) {
-    if (!(this instanceof AppDeployCmdTool))
-        throw new ReferenceError('Only create an AppDeployCmdTool as an instance object.');
+function AppDeployCmdTool (targetOsVersion) {
+    if (!(this instanceof AppDeployCmdTool)) { throw new ReferenceError('Only create an AppDeployCmdTool as an instance object.'); }
 
     DeploymentTool.call(this);
     this.targetOsVersion = targetOsVersion;
@@ -132,20 +130,20 @@ function AppDeployCmdTool(targetOsVersion) {
 AppDeployCmdTool.prototype = Object.create(DeploymentTool.prototype);
 AppDeployCmdTool.prototype.constructor = AppDeployCmdTool;
 
-AppDeployCmdTool.prototype.enumerateDevices = function() {
+AppDeployCmdTool.prototype.enumerateDevices = function () {
     var that = this;
     //  9              Emulator 8.1 720P 4.7 inch\r\n
     //    maps to
     // [(line), 9, 'Emulator 8.1 720P 4.7 inch']
     // Expansion is: space, index, spaces, name
     var LINE_TEST = /^\s(\d+?)\s+(.+?)$/m;
-    return spawn(that.path, ['/EnumerateDevices']).then(function(result) {
+    return spawn(that.path, ['/EnumerateDevices']).then(function (result) {
         var lines = result.split('\n');
-        var matchedLines = lines.filter(function(line) {
+        var matchedLines = lines.filter(function (line) {
             return LINE_TEST.test(line);
         });
 
-        var devices = matchedLines.map(function(line, arrayIndex) {
+        var devices = matchedLines.map(function (line, arrayIndex) {
             var match = line.match(LINE_TEST);
             var index = parseInt(match[1], 10);
             var name = match[2];
@@ -173,7 +171,7 @@ AppDeployCmdTool.prototype.enumerateDevices = function() {
 
 // Note: To account for CB-9482, we pass an extra parameter when retrying the call.  Be forwarned to check for that
 // if additional parameters are added in the future.
-AppDeployCmdTool.prototype.installAppPackage = function(pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin) {
+AppDeployCmdTool.prototype.installAppPackage = function (pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin) {
     var command = shouldUpdate ? '/update' : '/install';
     if (shouldLaunch) {
         command += 'launch';
@@ -182,7 +180,7 @@ AppDeployCmdTool.prototype.installAppPackage = function(pathToAppxPackage, targe
     var that = this;
     var result = spawn(this.path, [command, pathToAppxPackage, '/targetdevice:' + targetDevice.__shorthand]);
     if (targetDevice.type === 'emulator') {
-        result = result.then(null, function(e) {
+        result = result.then(null, function (e) {
             // CB-9482: AppDeployCmd also reports E_INVALIDARG during this process.  If so, try to repeat.
             if (e.code === E_INVALIDARG) {
                 return spawn(that.path, [command, pathToAppxPackage, '/targetdevice:' + targetDevice.__shorthand]);
@@ -195,23 +193,22 @@ AppDeployCmdTool.prototype.installAppPackage = function(pathToAppxPackage, targe
     return result;
 };
 
-AppDeployCmdTool.prototype.uninstallAppPackage = function(packageInfo, targetDevice) {
+AppDeployCmdTool.prototype.uninstallAppPackage = function (packageInfo, targetDevice) {
     // CB-9482: AppDeployCmd reports failure when targeting an emulator, but actually succeeds
     //  Further calls in the promise chain then are not executed (such as installAppPackage) because
     //  of the failure reported here.  By ensuring that this function always reports a success
-    //  state, it allows install to proceed.  (Install will fail if there is a legitimate 
-    //  uninstall failure such as due to no device).  
-    var assureSuccess = function() {};
+    //  state, it allows install to proceed.  (Install will fail if there is a legitimate
+    //  uninstall failure such as due to no device).
+    var assureSuccess = function () {};
     return spawn(this.path, ['/uninstall', packageInfo, '/targetdevice:' + targetDevice.__shorthand]).then(assureSuccess, assureSuccess);
 };
 
-AppDeployCmdTool.prototype.launchApp = function(packageInfo, targetDevice) {
+AppDeployCmdTool.prototype.launchApp = function (packageInfo, targetDevice) {
     return spawn(this.path, ['/launch', packageInfo, '/targetdevice:' + targetDevice.__shorthand]);
 };
 
-function WinAppDeployCmdTool(targetOsVersion) {
-    if (!(this instanceof WinAppDeployCmdTool))
-        throw new ReferenceError('Only create a WinAppDeployCmdTool as an instance object.');
+function WinAppDeployCmdTool (targetOsVersion) {
+    if (!(this instanceof WinAppDeployCmdTool)) { throw new ReferenceError('Only create a WinAppDeployCmdTool as an instance object.'); }
 
     DeploymentTool.call(this);
     this.targetOsVersion = targetOsVersion;
@@ -222,21 +219,22 @@ function WinAppDeployCmdTool(targetOsVersion) {
 WinAppDeployCmdTool.prototype = Object.create(DeploymentTool.prototype);
 WinAppDeployCmdTool.prototype.constructor = WinAppDeployCmdTool;
 
-WinAppDeployCmdTool.prototype.enumerateDevices = function() {
+WinAppDeployCmdTool.prototype.enumerateDevices = function () {
     var that = this;
     // 127.0.0.1   00000015-b21e-0da9-0000-000000000000    Lumia 1520 (RM-940)\r
     //  maps to
     // [(line), '127.0.0.1', '00000015-b21e-0da9-0000-000000000000', 'Lumia 1520 (RM-940)']
     // The expansion is: IP address, spaces, GUID, spaces, text name
-    var LINE_TEST = /^([\d\.]+?)\s+([\da-fA-F\-]+?)\s+(.+)$/m;
 
-    return spawn(that.path, ['devices']).then(function(result) {
+    var LINE_TEST = /^([\d\.]+?)\s+([\da-fA-F\-]+?)\s+(.+)$/m; /* eslint no-useless-escape : 0 */
+
+    return spawn(that.path, ['devices']).then(function (result) {
         var lines = result.split('\n');
-        var matchedLines = lines.filter(function(line) {
+        var matchedLines = lines.filter(function (line) {
             return LINE_TEST.test(line);
         });
 
-        var devices = matchedLines.map(function(line, arrayIndex) {
+        var devices = matchedLines.map(function (line, arrayIndex) {
             var match = line.match(LINE_TEST);
             var ip = match[1];
             var guid = match[2];
@@ -254,7 +252,7 @@ WinAppDeployCmdTool.prototype.enumerateDevices = function() {
     });
 };
 
-WinAppDeployCmdTool.prototype.installAppPackage = function(pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin) {
+WinAppDeployCmdTool.prototype.installAppPackage = function (pathToAppxPackage, targetDevice, shouldLaunch, shouldUpdate, pin) {
     if (shouldLaunch) {
         events.emit('warn', 'Cannot launch app with current version of Windows 10 SDK tools. ' +
             'You will have to launch the app after installation is completed.');
@@ -266,12 +264,12 @@ WinAppDeployCmdTool.prototype.installAppPackage = function(pathToAppxPackage, ta
         args.push(pin);
     }
 
-    return spawn(this.path, args).then(function() {
+    return spawn(this.path, args).then(function () {
         events.emit('log', 'Deployment completed successfully.');
     });
 };
 
-WinAppDeployCmdTool.prototype.uninstallAppPackage = function(packageInfo, targetDevice) {
+WinAppDeployCmdTool.prototype.uninstallAppPackage = function (packageInfo, targetDevice) {
     return spawn(this.path, ['uninstall', '-package', packageInfo, '-ip', targetDevice.__ip]);
 };
 


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


Mime
View raw message