You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by dp...@apache.org on 2018/05/08 18:21:48 UTC

[cordova-common] 02/02: Remove unused arguments and configure linter to report them

This is an automated email from the ASF dual-hosted git repository.

dpogue pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/cordova-common.git

commit 8d6511e0d9821e4c0127564d74cca1dc533bf24c
Author: Raphael von der GrĂ¼n <ra...@gmail.com>
AuthorDate: Fri May 4 10:34:15 2018 +0200

    Remove unused arguments and configure linter to report them
---
 .eslintrc.yml                            | 4 +++-
 spec/ConfigChanges/ConfigChanges.spec.js | 2 +-
 spec/FileUpdater.spec.js                 | 2 +-
 spec/PlatformJson.spec.js                | 2 +-
 src/ConfigParser/ConfigParser.js         | 2 +-
 src/FileUpdater.js                       | 6 +++---
 src/util/xml-helpers.js                  | 2 +-
 7 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/.eslintrc.yml b/.eslintrc.yml
index 7701c82..21a8e7b 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -8,4 +8,6 @@ rules:
   padded-blocks: off
   operator-linebreak: off
   no-throw-literal: off
-  
\ No newline at end of file
+  no-unused-vars:
+    - error
+    - args: after-used
diff --git a/spec/ConfigChanges/ConfigChanges.spec.js b/spec/ConfigChanges/ConfigChanges.spec.js
index ec7f250..0e200ae 100644
--- a/spec/ConfigChanges/ConfigChanges.spec.js
+++ b/spec/ConfigChanges/ConfigChanges.spec.js
@@ -56,7 +56,7 @@ function innerXML (xmltext) {
     return xmltext.replace(/^<[\w\s\-=\/"\.]+>/, '').replace(/<\/[\w\s\-=\/"\.]+>$/, ''); /* eslint no-useless-escape : 0 */
 }
 
-function get_munge_change (munge, keys) {
+function get_munge_change () {
     return mungeutil.deep_find.apply(null, arguments);
 }
 
diff --git a/spec/FileUpdater.spec.js b/spec/FileUpdater.spec.js
index 0dccc01..8370b97 100644
--- a/spec/FileUpdater.spec.js
+++ b/spec/FileUpdater.spec.js
@@ -118,7 +118,7 @@ var testDirStats = mockDirStats();
 var testFileStats = mockFileStats(now);
 var testFileStats2 = mockFileStats(now);
 var testFileStats3 = mockFileStats(now);
-var nullLogger = function (message) {};
+var nullLogger = function () {};
 
 describe('FileUpdater class', function () {
 
diff --git a/spec/PlatformJson.spec.js b/spec/PlatformJson.spec.js
index a92be65..fbf7746 100644
--- a/spec/PlatformJson.spec.js
+++ b/spec/PlatformJson.spec.js
@@ -123,7 +123,7 @@ describe('PlatformJson class', function () {
 describe('ModuleMetadata class', function () {
     it('Test 010 : should be constructable', function () {
         var meta;
-        expect(function name (params) {
+        expect(function () {
             meta = new ModuleMetadata('fakePlugin', {src: 'www/fakeModule.js'});
         }).not.toThrow();
         expect(meta instanceof ModuleMetadata).toBeTruthy();
diff --git a/src/ConfigParser/ConfigParser.js b/src/ConfigParser/ConfigParser.js
index 095ccf2..4f1cc39 100644
--- a/src/ConfigParser/ConfigParser.js
+++ b/src/ConfigParser/ConfigParser.js
@@ -91,7 +91,7 @@ ConfigParser.prototype = {
         return this.doc.getroot().attrib[attr];
     },
 
-    packageName: function (id) {
+    packageName: function () {
         return this.getAttribute('id');
     },
     setPackageName: function (id) {
diff --git a/src/FileUpdater.js b/src/FileUpdater.js
index c4eeb97..ea5d9e2 100644
--- a/src/FileUpdater.js
+++ b/src/FileUpdater.js
@@ -186,7 +186,7 @@ function updatePath (sourcePath, targetPath, options, log) {
         throw new Error('A target path is required.');
     }
 
-    log = log || function (message) { };
+    log = log || function () { };
 
     return updatePathInternal(sourcePath, targetPath, options, log);
 }
@@ -213,7 +213,7 @@ function updatePaths (pathMap, options, log) {
         throw new Error('An object mapping from target paths to source paths is required.');
     }
 
-    log = log || function (message) { };
+    log = log || function () { };
 
     var updated = false;
 
@@ -266,7 +266,7 @@ function mergeAndUpdateDir (sourceDirs, targetDir, options, log) {
         throw new Error('A target directory path is required.');
     }
 
-    log = log || function (message) { };
+    log = log || function () { };
 
     var rootDir = (options && options.rootDir) || '';
 
diff --git a/src/util/xml-helpers.js b/src/util/xml-helpers.js
index e2c8fd3..6b5d70f 100644
--- a/src/util/xml-helpers.js
+++ b/src/util/xml-helpers.js
@@ -328,7 +328,7 @@ function mergeXml (src, dest, platform, clobber) {
         });
 
         // write new preferences
-        Object.keys(prefHash).forEach(function (key, index) {
+        Object.keys(prefHash).forEach(function (key) {
             var element = et.SubElement(xml, 'preference');
             element.set('name', key);
             element.set('value', this[key]);

-- 
To stop receiving notification emails like this one, please contact
dpogue@apache.org.

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