From 9346c0ef9938b44f3711d588ebdb6800bc077d8f Mon Sep 17 00:00:00 2001 From: jaubourg Date: Thu, 18 Oct 2012 00:50:01 -0400 Subject: [PATCH 1/2] adds strict rule to jshint options (except for test files). "use strict" is added to the main jQuery closure and some "could-be-unsafe" `this` trickery in effects is silenced. --- .jshintrc | 1 + src/.jshintrc | 2 ++ src/effects.js | 1 + src/intro.js | 1 + 4 files changed, 5 insertions(+) diff --git a/.jshintrc b/.jshintrc index 5ff1e697da..79ed65fc1e 100644 --- a/.jshintrc +++ b/.jshintrc @@ -9,6 +9,7 @@ "node": true, "quotmark": "double", "smarttabs": true, + "strict": true, "trailing": true, "undef": true, "unused": true diff --git a/src/.jshintrc b/src/.jshintrc index d74bf14fd7..bc4ae77505 100644 --- a/src/.jshintrc +++ b/src/.jshintrc @@ -6,8 +6,10 @@ "evil": true, "expr": true, "maxerr": 100, + "newcap": false, "quotmark": "double", "smarttabs": true, + "strict": true, "sub": true, "trailing": true, "undef": true, diff --git a/src/effects.js b/src/effects.js index dcc6c00b7c..7627e3a23b 100644 --- a/src/effects.js +++ b/src/effects.js @@ -233,6 +233,7 @@ jQuery.Animation = jQuery.extend( Animation, { }); function defaultPrefilter( elem, props, opts ) { + /*jshint validthis:true */ var index, prop, value, length, dataShow, tween, hooks, oldfire, anim = this, style = elem.style, diff --git a/src/intro.js b/src/intro.js index c041bb4bad..0b98012ec6 100644 --- a/src/intro.js +++ b/src/intro.js @@ -12,3 +12,4 @@ * Date: @DATE */ (function( window, undefined ) { +"use strict"; From 739ba96318f65d2f2c3c80772519fc0887a8c798 Mon Sep 17 00:00:00 2001 From: jaubourg Date: Fri, 19 Oct 2012 10:09:52 +0200 Subject: [PATCH 2/2] @mikesherov says `strict` is redundant when `node` is already there --- .jshintrc | 1 - 1 file changed, 1 deletion(-) diff --git a/.jshintrc b/.jshintrc index 79ed65fc1e..5ff1e697da 100644 --- a/.jshintrc +++ b/.jshintrc @@ -9,7 +9,6 @@ "node": true, "quotmark": "double", "smarttabs": true, - "strict": true, "trailing": true, "undef": true, "unused": true