You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cordova.apache.org by ag...@apache.org on 2013/09/18 17:02:54 UTC

js commit: [CB-3964] Use grunt's built in jshint.

Updated Branches:
  refs/heads/master 45b505752 -> f0458b6cd


[CB-3964] Use grunt's built in jshint.

You may need to delete and re-install node_modules for this to work.


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

Branch: refs/heads/master
Commit: f0458b6cd13557702fa869b999feec944c313d19
Parents: 45b5057
Author: Lucas Holmquist <lh...@redhat.com>
Authored: Fri Sep 6 09:17:11 2013 -0400
Committer: Andrew Grieve <ag...@chromium.org>
Committed: Wed Sep 18 11:02:19 2013 -0400

----------------------------------------------------------------------
 Gruntfile.js           | 27 +--------------------------
 lib/common/urlutil.js  |  4 ++--
 lib/scripts/require.js |  3 +++
 lib/test/mockxhr.js    |  2 ++
 4 files changed, 8 insertions(+), 28 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f0458b6c/Gruntfile.js
----------------------------------------------------------------------
diff --git a/Gruntfile.js b/Gruntfile.js
index 9afeded..122bcee 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -148,36 +148,11 @@ module.exports = function(grunt) {
         }, done);
     });
 
-    // TODO - Delete this task and use Grunt's built-in jshint (CB-3964).
-    grunt.registerTask('_hint', 'Runs jshint.', function() {
-        var done = this.async();
-        var knownWarnings = [
-            "Redefinition of 'FileReader'",
-            "Redefinition of 'require'",
-            "Read only",
-            "Redefinition of 'console'"
-        ];
-        var filterKnownWarnings = function(el, index, array) {
-            var wut = true;
-            // filter out the known warnings listed out above
-            knownWarnings.forEach(function(e) {
-                wut = wut && (el.indexOf(e) == -1);
-            });
-            wut = wut && (!el.match(/\d+ errors/));
-            return wut;
-        };
-
-        childProcess.exec("jshint lib", function(err,stdout,stderr) {
-            var exs = stdout.split('\n');
-            grunt.log.writeln(exs.filter(filterKnownWarnings).join('\n'));
-            done();
-        });
-    });
     grunt.loadNpmTasks('grunt-contrib-clean');
     grunt.loadNpmTasks('grunt-contrib-jshint');
 
     // Default task(s).
-    grunt.registerTask('build', ['cordovajs', '_hint', '_complainwhitespace']);
+    grunt.registerTask('build', ['cordovajs', 'jshint', '_complainwhitespace']);
     grunt.registerTask('default', ['build', '_test']);
     grunt.registerTask('test', ['build', '_test']);
     grunt.registerTask('btest', ['build', '_btest']);

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f0458b6c/lib/common/urlutil.js
----------------------------------------------------------------------
diff --git a/lib/common/urlutil.js b/lib/common/urlutil.js
index 4741a51..8cfae5a 100644
--- a/lib/common/urlutil.js
+++ b/lib/common/urlutil.js
@@ -27,6 +27,6 @@ var anchorEl = document.createElement('a');
  * For relative URLs, converts them to absolute ones.
  */
 urlutil.makeAbsolute = function(url) {
-  anchorEl.href = url;
-  return anchorEl.href;
+    anchorEl.href = url;
+    return anchorEl.href;
 };

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f0458b6c/lib/scripts/require.js
----------------------------------------------------------------------
diff --git a/lib/scripts/require.js b/lib/scripts/require.js
index 93f8d16..914bea4 100644
--- a/lib/scripts/require.js
+++ b/lib/scripts/require.js
@@ -19,6 +19,9 @@
  *
 */
 
+/*jshint -W079 */
+/*jshint -W020 */
+
 var require,
     define;
 

http://git-wip-us.apache.org/repos/asf/cordova-js/blob/f0458b6c/lib/test/mockxhr.js
----------------------------------------------------------------------
diff --git a/lib/test/mockxhr.js b/lib/test/mockxhr.js
index 821f5ec..871811d 100644
--- a/lib/test/mockxhr.js
+++ b/lib/test/mockxhr.js
@@ -19,6 +19,8 @@
  *
 */
 
+/*jshint -W020 */
+
 var utils = require('cordova/utils');
 var activeXhrs = [];
 var isInstalled = false;