diff --git a/.jshintrc b/.jshintrc index b6a0f58e..e8ce16eb 100644 --- a/.jshintrc +++ b/.jshintrc @@ -35,6 +35,15 @@ "predef": [ "mediaWiki", "jQuery", - "QUnit" + + /* Qunit specific rules */ + "QUnit", + "module", + "expect", + "start", + "stop", + "ok", + "test", + "strictEqual" ] } diff --git a/resources/js/ext.uls.init.js b/resources/js/ext.uls.init.js index 0bc16829..0b1bb2e5 100644 --- a/resources/js/ext.uls.init.js +++ b/resources/js/ext.uls.init.js @@ -66,6 +66,7 @@ return ( window.navigator.language || window.navigator.userLanguage ).split( '-' )[0]; }; + /*jshint camelcase:false*/ mw.uls.getCountryCode = function () { return window.Geo && ( window.Geo.country || window.Geo.country_code ); }; diff --git a/resources/js/ext.uls.inputsettings.js b/resources/js/ext.uls.inputsettings.js index 46845540..0abe9528 100644 --- a/resources/js/ext.uls.inputsettings.js +++ b/resources/js/ext.uls.inputsettings.js @@ -477,9 +477,8 @@ if ( success ) { // Live ime update this.$parent.hide(); - } else { - // FIXME failure. what to do?! } + // FIXME in case of failure. what to do?! }, /** diff --git a/resources/js/ext.uls.preferences.js b/resources/js/ext.uls.preferences.js index d60bd301..cfefb634 100644 --- a/resources/js/ext.uls.preferences.js +++ b/resources/js/ext.uls.preferences.js @@ -167,8 +167,9 @@ * @param callback */ save: function ( callback ) { - var ulsPreferences = this; - + var ulsPreferences = this, + successFunction, + failFunction; callback = callback || $.noop; if ( this.isAnon ) { @@ -176,7 +177,6 @@ $.jStorage.set( this.preferenceName, this.preferences ); callback.call( this, true ); } else { - var successFunction, failFunction; successFunction = function () { callback.call( this, true ); diff --git a/tests/qunit/ext.uls.tests.js b/tests/qunit/ext.uls.tests.js index c3733a0f..6257222f 100644 --- a/tests/qunit/ext.uls.tests.js +++ b/tests/qunit/ext.uls.tests.js @@ -17,7 +17,7 @@ * @licence MIT License */ -( function ( $ ) { +( function ( $, mw ) { 'use strict'; module( 'ext.uls', QUnit.newMwEnvironment() ); @@ -68,4 +68,4 @@ prefs.set( prefName, undefined ); prefs.save(); } ); -}( jQuery ) ); +}( jQuery, mediaWiki ) );