jenkins-bot has submitted this change and it was merged.
Change subject: Make JSHint pass
......................................................................
Make JSHint pass
Use undef:false to tolerate undefined references.
It's still useful to have JSHint here so that it is known
what errors are intentionally allowed. As well as to ensure
general syntax compliance aside from code quality.
If and when invalid syntax will be tested as well, just add
the filepath to a jshintignore file.
Change-Id: Ia8c9817107e08389db338254be37529cb0744a10
---
M .jshintrc
M modules/ext.Buggy.ajax.js
M modules/ext.Buggy.click.js
M modules/ext.Buggy.misc-cb.js
M modules/ext.Buggy.mwload.js
M modules/ext.Buggy.onready.js
M modules/ext.Buggy.setTimeout.js
M modules/ext.Buggy.startup.js
8 files changed, 30 insertions(+), 11 deletions(-)
Approvals:
Gergő Tisza: Looks good to me, approved
jenkins-bot: Verified
diff --git a/.jshintrc b/.jshintrc
index 4cd914b..9801113 100644
--- a/.jshintrc
+++ b/.jshintrc
@@ -1,8 +1,20 @@
{
- "predef": [
- "mediaWiki",
- "jQuery"
- ],
+ // Enforcing
+ "bitwise": true,
+ "eqeqeq": true,
+ "es3": true,
+ "freeze": true,
+ "latedef": true,
+ "noarg": true,
+ "nonew": true,
+ "undef": true,
+ "unused": true,
+
+ // Environment
"browser": true,
- "smarttabs": true
+
+ "globals": {
+ "jQuery": false,
+ "mw": false
+ }
}
diff --git a/modules/ext.Buggy.ajax.js b/modules/ext.Buggy.ajax.js
index b387ee2..b92a01d 100644
--- a/modules/ext.Buggy.ajax.js
+++ b/modules/ext.Buggy.ajax.js
@@ -1,3 +1,4 @@
+/*jshint undef:false */
( function ( $ ) {
$.get( '/wiki/Main_Page', { success: function() {
callANonExistentFunctionOnAjaxSuccess(); } } );
}( jQuery ) );
diff --git a/modules/ext.Buggy.click.js b/modules/ext.Buggy.click.js
index 60516ec..00c7a7f 100644
--- a/modules/ext.Buggy.click.js
+++ b/modules/ext.Buggy.click.js
@@ -1,3 +1,4 @@
+/*jshint undef:false */
( function ( $ ) {
$( '#firstHeading' ).click( function() {
callANonExistentFunctionOnClick(); } ).click();
}( jQuery ) );
diff --git a/modules/ext.Buggy.misc-cb.js b/modules/ext.Buggy.misc-cb.js
index a87e6b5..67c8454 100644
--- a/modules/ext.Buggy.misc-cb.js
+++ b/modules/ext.Buggy.misc-cb.js
@@ -1,3 +1,4 @@
+/*jshint undef:false */
( function () {
var i, xhr, ids = [
'MSXML2.XMLHTTP.3.0',
@@ -22,5 +23,5 @@
}
};
xhr.open( 'GET', '/wiki/Main_Page', true );
- xhr.send( '' )
+ xhr.send( '' );
}() );
diff --git a/modules/ext.Buggy.mwload.js b/modules/ext.Buggy.mwload.js
index 8a4677f..4bec417 100644
--- a/modules/ext.Buggy.mwload.js
+++ b/modules/ext.Buggy.mwload.js
@@ -1,3 +1,4 @@
-( function ( $ ) {
- mw.loader.using( 'ext.Buggy.mwload', function() {
callANonExistentFunctionOnMwLoadSuccess(); } )
-}( jQuery ) );
+/*jshint undef:false */
+( function () {
+ mw.loader.using( 'ext.Buggy.mwload', function() {
callANonExistentFunctionOnMwLoadSuccess(); } );
+}() );
diff --git a/modules/ext.Buggy.onready.js b/modules/ext.Buggy.onready.js
index 4d0888f..4ea7ce7 100644
--- a/modules/ext.Buggy.onready.js
+++ b/modules/ext.Buggy.onready.js
@@ -1,3 +1,4 @@
+/*jshint undef:false */
( function ( $ ) {
- $( function() { callANonExistentFunctionOnDomReady() } );
+ $( function() { callANonExistentFunctionOnDomReady(); } );
}( jQuery ) );
diff --git a/modules/ext.Buggy.setTimeout.js b/modules/ext.Buggy.setTimeout.js
index 21f33a2..c9eee6b 100644
--- a/modules/ext.Buggy.setTimeout.js
+++ b/modules/ext.Buggy.setTimeout.js
@@ -1,3 +1,4 @@
+/*jshint undef:false */
( function () {
- setTimeout( function() { callANonExistentFunctionInSetTimeout() }, 0 );
+ setTimeout( function() { callANonExistentFunctionInSetTimeout(); }, 0 );
}() );
diff --git a/modules/ext.Buggy.startup.js b/modules/ext.Buggy.startup.js
index 3a42054..98bafbc 100644
--- a/modules/ext.Buggy.startup.js
+++ b/modules/ext.Buggy.startup.js
@@ -1,3 +1,4 @@
+/*jshint undef:false */
( function () {
callANonExistentFunctionAtModuleInitializationTime();
}() );
--
To view, visit https://gerrit.wikimedia.org/r/197653
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8c9817107e08389db338254be37529cb0744a10
Gerrit-PatchSet: 3
Gerrit-Project: mediawiki/extensions/Buggy
Gerrit-Branch: master
Gerrit-Owner: Krinkle <[email protected]>
Gerrit-Reviewer: Gergő Tisza <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits