diff --git a/bin/templates/scripts/cordova/Api.js b/bin/templates/scripts/cordova/Api.js index 82233e9f5c..962333b202 100644 --- a/bin/templates/scripts/cordova/Api.js +++ b/bin/templates/scripts/cordova/Api.js @@ -94,7 +94,7 @@ function Api (platform, platformRootDir, events) { defaultConfigXml: path.join(this.root, 'cordova/defaults.xml'), pbxproj: path.join(this.root, xcodeProjDir, 'project.pbxproj'), xcodeProjDir: path.join(this.root, xcodeProjDir), - xcodeCordovaProj: xcodeCordovaProj + xcodeCordovaProj }; } @@ -348,7 +348,7 @@ Api.prototype.addPodSpecs = function (plugin, podSpecs, frameworkPods) { if (obj.declarations[key] === 'true') { const declaration = Podfile.proofDeclaration(key); const podJson = { - declaration: declaration + declaration }; const val = podsjsonFile.getDeclaration(declaration); if (val) { @@ -462,7 +462,7 @@ Api.prototype.removePodSpecs = function (plugin, podSpecs, frameworkPods) { if (obj.declarations[key] === 'true') { const declaration = Podfile.proofDeclaration(key); const podJson = { - declaration: declaration + declaration }; const val = podsjsonFile.getDeclaration(declaration); if (val) { diff --git a/bin/templates/scripts/cordova/lib/BridgingHeader.js b/bin/templates/scripts/cordova/lib/BridgingHeader.js index d353476871..fec237482b 100644 --- a/bin/templates/scripts/cordova/lib/BridgingHeader.js +++ b/bin/templates/scripts/cordova/lib/BridgingHeader.js @@ -67,7 +67,7 @@ BridgingHeader.prototype.__parseForBridgingHeader = text => { case 'comment': if (i + 1 < text.length && text[i] === '*' && text[i + 1] === '/') { i += 2; - list.push({ type: type, code: text.slice(start, i) }); + list.push({ type, code: text.slice(start, i) }); type = 'code'; start = i; } else { @@ -77,7 +77,7 @@ BridgingHeader.prototype.__parseForBridgingHeader = text => { case 'line-comment': if (i < text.length && text[i] === '\n') { i += 1; - list.push({ type: type, code: text.slice(start, i) }); + list.push({ type, code: text.slice(start, i) }); type = 'code'; start = i; } else { @@ -88,19 +88,19 @@ BridgingHeader.prototype.__parseForBridgingHeader = text => { default: if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '*') { // comment if (start < i) { - list.push({ type: type, code: text.slice(start, i) }); + list.push({ type, code: text.slice(start, i) }); } type = 'comment'; start = i; } else if (i + 1 < text.length && text[i] === '/' && text[i + 1] === '/') { // line comment if (start < i) { - list.push({ type: type, code: text.slice(start, i) }); + list.push({ type, code: text.slice(start, i) }); } type = 'line-comment'; start = i; } else if (i < text.length && text[i] === '\n') { i += 1; - list.push({ type: type, code: text.slice(start, i) }); + list.push({ type, code: text.slice(start, i) }); start = i; } else { i += 1; @@ -109,7 +109,7 @@ BridgingHeader.prototype.__parseForBridgingHeader = text => { } } if (start < i) { - list.push({ type: type, code: text.slice(start, i) }); + list.push({ type, code: text.slice(start, i) }); } return list; }; diff --git a/bin/templates/scripts/cordova/lib/Podfile.js b/bin/templates/scripts/cordova/lib/Podfile.js index 06c823c33a..948feee3e3 100644 --- a/bin/templates/scripts/cordova/lib/Podfile.js +++ b/bin/templates/scripts/cordova/lib/Podfile.js @@ -193,9 +193,9 @@ Podfile.prototype.addSpec = function (name, spec) { if (typeof spec === 'string') { if (spec.startsWith(':')) { - spec = { name: name, options: spec }; + spec = { name, options: spec }; } else { - spec = { name: name, spec: spec }; + spec = { name, spec }; } } diff --git a/bin/templates/scripts/cordova/lib/check_reqs.js b/bin/templates/scripts/cordova/lib/check_reqs.js index 27309c0aa1..9360ee9447 100644 --- a/bin/templates/scripts/cordova/lib/check_reqs.js +++ b/bin/templates/scripts/cordova/lib/check_reqs.js @@ -156,7 +156,7 @@ function checkTool (tool, minVersion, message, toolFriendlyName) { return versions.get_tool_version(tool).then(version => { version = version.trim(); return versions.compareVersions(version, minVersion) >= 0 - ? Q.resolve({ version: version }) + ? Q.resolve({ version }) : Q.reject('Cordova needs ' + toolFriendlyName + ' version ' + minVersion + ' or greater, you have version ' + version + '. ' + (message || '')); }); diff --git a/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js b/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js index 7e167f998d..50d00f384e 100644 --- a/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js +++ b/bin/templates/scripts/cordova/lib/plugman/pluginHandlers.js @@ -118,7 +118,7 @@ const handlers = { events.emit('verbose', '"Embed Frameworks" Build Phase (Embedded Binaries) does not exist, creating it.'); project.xcode.addBuildPhase([], 'PBXCopyFilesBuildPhase', 'Embed Frameworks', null, 'frameworks'); } - const opt = { customFramework: true, embed: embed, link: link, sign: true }; + const opt = { customFramework: true, embed, link, sign: true }; events.emit('verbose', util.format('Adding custom framework to project... %s -> %s', src, JSON.stringify(opt))); project.xcode.addFramework(project_relative, opt); events.emit('verbose', util.format('Custom framework added to project. %s -> %s', src, JSON.stringify(opt))); diff --git a/bin/templates/scripts/cordova/lib/prepare.js b/bin/templates/scripts/cordova/lib/prepare.js index ef2222a0b1..0f70d88794 100644 --- a/bin/templates/scripts/cordova/lib/prepare.js +++ b/bin/templates/scripts/cordova/lib/prepare.js @@ -607,10 +607,10 @@ function mapLaunchStoryboardContents (splashScreens, launchStoryboardImagesDir) sizes.forEach(width => { sizes.forEach(height => { const item = { - idiom: idiom, - scale: scale, - width: width, - height: height + idiom, + scale, + width, + height }; /* examples of the search pattern: diff --git a/bin/templates/scripts/cordova/lib/projectFile.js b/bin/templates/scripts/cordova/lib/projectFile.js index 2981045bfe..35a5a9178d 100644 --- a/bin/templates/scripts/cordova/lib/projectFile.js +++ b/bin/templates/scripts/cordova/lib/projectFile.js @@ -86,7 +86,7 @@ function parseProjectFile (locations) { getUninstaller: function (name) { return pluginHandlers.getUninstaller(name); }, - frameworks: frameworks + frameworks }; return cachedProjectFiles[project_dir]; } @@ -97,7 +97,7 @@ function purgeProjectFileCache (project_dir) { module.exports = { parse: parseProjectFile, - purgeProjectFileCache: purgeProjectFileCache + purgeProjectFileCache }; xcode.project.prototype.pbxEmbedFrameworksBuildPhaseObj = function (target) { diff --git a/tests/spec/unit/BridgingHeader.spec.js b/tests/spec/unit/BridgingHeader.spec.js index 6093475203..7e02ce764d 100644 --- a/tests/spec/unit/BridgingHeader.spec.js +++ b/tests/spec/unit/BridgingHeader.spec.js @@ -59,7 +59,7 @@ describe('unit tests for BridgingHeader module', () => { existsSyncSpy.and.returnValue(true); readFileSyncSpy.and.callFake((read_path, charset) => bridgingHeaderFileContent); writeFileSyncSpy.and.callFake((write_path, text, charset) => { - result_json = { write_path: write_path, text: text, charset: charset }; + result_json = { write_path, text, charset }; }); let bridgingHeader = new BridgingHeader(dummy_path); @@ -90,7 +90,7 @@ describe('unit tests for BridgingHeader module', () => { readFileSyncSpy.and.callFake((read_path, charset) => bridgingHeaderFileContent); writeFileSyncSpy.and.callFake((write_path, text, charset) => { bridgingHeaderFileContent = text; - result_json = { write_path: write_path, text: text, charset: charset }; + result_json = { write_path, text, charset }; }); let bridgingHeader = new BridgingHeader(dummy_path); diff --git a/tests/spec/unit/prepare.spec.js b/tests/spec/unit/prepare.spec.js index 2bdacc1787..102511f9aa 100644 --- a/tests/spec/unit/prepare.spec.js +++ b/tests/spec/unit/prepare.spec.js @@ -59,9 +59,9 @@ describe('prepare', () => { describe('launch storyboard feature (CB-9762)', () => { function makeSplashScreenEntry (src, width, height) { return { - src: src, - width: width, - height: height + src, + width, + height }; }