You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by GitBox <gi...@apache.org> on 2018/09/14 15:00:06 UTC

[GitHub] brodybits closed pull request #61: ESLint Dependencies Update, Configure and Corrections

brodybits closed pull request #61: ESLint Dependencies Update, Configure and Corrections
URL: https://github.com/apache/cordova-osx/pull/61
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/.eslintignore b/.eslintignore
index 4808be4d..e46fecef 100644
--- a/.eslintignore
+++ b/.eslintignore
@@ -1,3 +1,4 @@
 bin/node_modules/*
 bin/templates/project/*
-tests
+tests/cdv-test-project/*
+tests/CordovaLibTests/*
diff --git a/.eslintrc.yml b/.eslintrc.yml
index 0cccb8c7..cb5a4654 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -1,5 +1,6 @@
 root: true
 extends: semistandard
+
 rules:
   indent:
     - error
@@ -7,4 +8,4 @@ rules:
   camelcase: off
   padded-blocks: off
   operator-linebreak: off
-  no-throw-literal: off
\ No newline at end of file
+  no-throw-literal: off
diff --git a/package.json b/package.json
index 7ff6dc49..10230469 100644
--- a/package.json
+++ b/package.json
@@ -19,7 +19,7 @@
     "jasmine": "npm run objc-tests && npm run jasmine-tests",
     "objc-tests": "jasmine tests/spec/cordovalib.spec.js",
     "jasmine-tests": "jasmine tests/spec/create.spec.js tests/spec/platform.spec.js",
-    "eslint": "node node_modules/eslint/bin/eslint bin && node node_modules/eslint/bin/eslint tests"
+    "eslint": "eslint bin tests"
   },
   "author": "Apache Software Foundation",
   "license": "Apache-2.0",
@@ -34,13 +34,13 @@
   },
   "devDependencies": {
     "coffee-script": "^1.7.1",
-    "eslint": "^4.0.0",
+    "eslint": "^4.19.1",
     "eslint-config-semistandard": "^11.0.0",
     "eslint-config-standard": "^10.2.1",
-    "eslint-plugin-import": "^2.3.0",
-    "eslint-plugin-node": "^5.0.0",
-    "eslint-plugin-promise": "^3.5.0",
-    "eslint-plugin-standard": "^3.0.1",
+    "eslint-plugin-import": "^2.14.0",
+    "eslint-plugin-node": "^5.2.1",
+    "eslint-plugin-promise": "^3.8.0",
+    "eslint-plugin-standard": "^3.1.0",
     "jasmine": "^3.1.0",
     "nodeunit": "^0.8.7",
     "tmp": "^0.0.26",
diff --git a/tests/spec/.eslintrc.yml b/tests/spec/.eslintrc.yml
index 6afba65a..73255ae2 100644
--- a/tests/spec/.eslintrc.yml
+++ b/tests/spec/.eslintrc.yml
@@ -1,2 +1,2 @@
 env:
-    jasmine: true
\ No newline at end of file
+  jasmine: true
diff --git a/tests/spec/cordovalib.spec.js b/tests/spec/cordovalib.spec.js
index 4cbce2ef..73c3fb10 100644
--- a/tests/spec/cordovalib.spec.js
+++ b/tests/spec/cordovalib.spec.js
@@ -17,17 +17,20 @@
  under the License.
  */
 
-var shell = require('shelljs'),
-    spec = __dirname,
-    path = require('path'),
-    util = require('util'),
-    tmp = require('tmp');
+var shell = require('shelljs');
 
-    var tests_dir = path.join(spec, '..');
+var path = require('path');
+var util = require('util');
 
-describe('cordova-lib', function() {
+var tmp = require('tmp');
 
-    it('objective-c unit tests', function() {
+var spec = __dirname;
+
+var tests_dir = path.join(spec, '..');
+
+describe('cordova-lib', function () {
+
+    it('objective-c unit tests', function () {
         var return_code = 0;
         var command;
         var artifacts_dir = tmp.dirSync().name;
diff --git a/tests/spec/create.spec.js b/tests/spec/create.spec.js
index ec1ec429..62942494 100644
--- a/tests/spec/create.spec.js
+++ b/tests/spec/create.spec.js
@@ -17,23 +17,26 @@
  under the License.
  */
 
-var shell = require('shelljs'),
-    spec = __dirname,
-    path = require('path'),
-    util = require('util'),
-    fs = require('fs');
+var shell = require('shelljs');
 
-    var cordova_bin = path.join(spec, '../..', 'bin');
-    var tmp = require('tmp').dirSync().name;
+var path = require('path');
+var util = require('util');
+var fs = require('fs');
 
-function initProjectPath(projectname) {
+var spec = __dirname;
+
+var cordova_bin = path.join(spec, '../..', 'bin');
+
+var tmp = require('tmp').dirSync().name;
+
+function initProjectPath (projectname) {
     // remove existing folder
     var pPath = path.join(tmp, projectname);
     shell.rm('-rf', pPath);
     return pPath;
 }
 
-function createProject(projectname, projectid) {
+function createProject (projectname, projectid) {
     var projectPath = initProjectPath(projectname);
 
     // create the project
@@ -47,7 +50,7 @@ function createProject(projectname, projectid) {
     return projectPath;
 }
 
-function createAndBuild(projectname, projectid) {
+function createAndBuild (projectname, projectid) {
     var projectPath = createProject(projectname, projectid);
 
     // build the project
@@ -60,9 +63,9 @@ function createAndBuild(projectname, projectid) {
     shell.rm('-rf', projectPath);
 }
 
-describe('create', function() {
+describe('create', function () {
 
-    it('create project with ascii+unicode name, and spaces', function() {
+    it('create project with ascii+unicode name, and spaces', function () {
         var projectname = '応応応応 hello 用用用用';
         var projectid = 'com.test.app6';
 
diff --git a/tests/spec/platform.spec.js b/tests/spec/platform.spec.js
index 581b0521..e70f9c84 100644
--- a/tests/spec/platform.spec.js
+++ b/tests/spec/platform.spec.js
@@ -17,42 +17,42 @@
  under the License.
  */
 
-var shell = require('shelljs'),
-    spec = __dirname,
-    path = require('path'),
-    util = require('util'),
-    fs = require('fs');
+var shell = require('shelljs');
 
-    var cordova_bin = path.join(spec, '../..', 'bin');
-    var test_projectPath = path.join(spec, '../', 'cdv-test-project');
-    var test_platformPath = path.join(test_projectPath, 'platforms', 'osx');
+var path = require('path');
+var util = require('util');
+var fs = require('fs');
 
-    var tmp = require('tmp').dirSync().name;
+var spec = __dirname;
 
-function initProject() {
+var test_projectPath = path.join(spec, '../', 'cdv-test-project');
+
+var test_platformPath = path.join(test_projectPath, 'platforms', 'osx');
+
+function initProject () {
     // remove existing folder
     var pPath = path.join(test_projectPath, 'platforms');
     shell.rm('-rf', pPath);
 }
 
-describe('platform add', function() {
+describe('platform add', function () {
 
-    beforeEach(function() {
+    beforeEach(function () {
         initProject();
 
         shell.cd(test_projectPath);
         var command = 'cordova platform add ../../';
         console.log('executing "%s" in "%s"', command, shell.pwd());
-        var return_code = shell.exec(command, { silent: false}).code;
+        var return_code = shell.exec(command, { silent: false }).code;
         expect(return_code).toBe(0);
     });
 
-    it('should have a config.xml', function() {
+    it('should have a config.xml', function () {
         var configXmlPath = path.join(test_platformPath, 'HelloCordova', 'config.xml');
         expect(fs.existsSync(configXmlPath)).toBe(true);
     });
 
-    it('should have the correct icons', function() {
+    it('should have the correct icons', function () {
 
         var platformIcons = [
             {name: 'icon-16x16.png', width: 16, height: 16},
@@ -64,15 +64,15 @@ describe('platform add', function() {
             {name: 'icon-1024x1024.png', width: 1024, height: 1024}
         ];
 
-        var appIconsPath = path.join(test_platformPath, 'HelloCordova','Images.xcassets','AppIcon.appiconset');
+        var appIconsPath = path.join(test_platformPath, 'HelloCordova', 'Images.xcassets', 'AppIcon.appiconset');
         var srcIcon = path.join(test_projectPath, 'res', 'test-64x64.png');
-        platformIcons.forEach(function(iconDef) {
+        platformIcons.forEach(function (iconDef) {
             var iconPath = path.join(appIconsPath, iconDef.name);
             expect(fs.existsSync(iconPath)).toBe(true);
 
             // check if the icons are the same as the one specified in the config.xml
             var cmd = util.format('cmp "%s" "%s"', srcIcon, iconPath);
-            var return_code = shell.exec(cmd, { silent: false}).code;
+            var return_code = shell.exec(cmd, { silent: false }).code;
             expect(return_code).toBe(0);
 
         });


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

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