cordova-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From agri...@apache.org
Subject [2/2] git commit: CB-4871 Remove jshint dependency.
Date Thu, 09 Jan 2014 16:43:16 GMT
CB-4871 Remove jshint dependency.

Was used only to give better error message when parsing of config.json
fails. Node should give a good-enough message (plus this is a niche
file).


Project: http://git-wip-us.apache.org/repos/asf/cordova-cli/repo
Commit: http://git-wip-us.apache.org/repos/asf/cordova-cli/commit/011f9794
Tree: http://git-wip-us.apache.org/repos/asf/cordova-cli/tree/011f9794
Diff: http://git-wip-us.apache.org/repos/asf/cordova-cli/diff/011f9794

Branch: refs/heads/master
Commit: 011f9794f2bc320d94cb0ee99b88472a1277e128
Parents: 75af910
Author: Andrew Grieve <agrieve@chromium.org>
Authored: Thu Jan 9 11:42:19 2014 -0500
Committer: Andrew Grieve <agrieve@chromium.org>
Committed: Thu Jan 9 11:42:19 2014 -0500

----------------------------------------------------------------------
 package.json  |  1 -
 src/config.js | 14 ++------------
 2 files changed, 2 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/011f9794/package.json
----------------------------------------------------------------------
diff --git a/package.json b/package.json
index 21ff10a..4663e6e 100644
--- a/package.json
+++ b/package.json
@@ -40,7 +40,6 @@
     "npm": "1.3.x",
     "q": "~0.9",
     "optimist": "0.6.0",
-    "jshint": "~1.1.0",
     "mime": "~1.2.11",
     "lodash": "~2.4.0"
   },

http://git-wip-us.apache.org/repos/asf/cordova-cli/blob/011f9794/src/config.js
----------------------------------------------------------------------
diff --git a/src/config.js b/src/config.js
index 5f2836c..8c7fb9d 100644
--- a/src/config.js
+++ b/src/config.js
@@ -20,8 +20,7 @@
 var path          = require('path'),
     fs            = require('fs'),
     url           = require('url'),
-    shell         = require('shelljs'),
-    JSHINT        = require("jshint").JSHINT;
+    shell         = require('shelljs');
 
 module.exports = function config(project_root, opts) {
     var json = module.exports.read(project_root);
@@ -43,16 +42,7 @@ module.exports.read = function get_config(project_root) {
         return module.exports.write(project_root, {});
     } else {
         var data = fs.readFileSync(config_json, 'utf-8');
-        try {
-            return JSON.parse(data);
-        } catch (e) {
-            JSHINT(data);
-            var err = JSHINT.errors[0];
-            if (err) {
-                throw new Error('Parsing "'+config_json+'" at line '+err.line+" col "+err.character+";
"+err.reason);
-            }
-            throw e;
-        }
+        return JSON.parse(data);
     }
 };
 


Mime
View raw message