8000 Build: Enable "unused" option in jshint - Remove unused variables fro… · jquery/jquery-ui@066c304 · GitHub
Skip to content {"props":{"docsUrl":"https://docs.github.com/get-started/accessibility/keyboard-shortcuts"}}

Commit 066c304

Browse files
mikesherovkborchers
authored andcommitted
Build: Enable "unused" option in jshint - Remove unused variables from codebase. - Closes gh-788
Squashed commit of the following: commit 7f19f92 Author: Mike Sherov <mike.sherov@gmail.com> Date: Tue Oct 23 10:34:28 2012 -0400 put back in fake args for signatures that we want to keep commit 257505a Author: Mike Sherov <mike.sherov@gmail 3582 .com> Date: Tue Oct 23 08:10:20 2012 -0400 changes per @scott_gonzalez commit 1272548 Author: Mike Sherov <mike.sherov@gmail.com> Date: Mon Oct 22 22:54:05 2012 -0400 clean up unused vars in ui directory commit 563595e Author: Mike Sherov <mike.sherov@gmail.com> Date: Mon Oct 22 22:37:42 2012 -0400 clean up unused vars in grunt and tests
1 parent 9406380 commit 066c304

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+282
-311
lines changed

.jshintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@
77
"node": true,
88
"onevar": true,
99
"trailing": true,
10-
"undef": true
10+
"undef": true,
11+
"unused": true
1112
}

build/release/release.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ function abort( msg ) {
425425
function walk( methods ) {
426426
var method = methods.shift();
427427

428-
function next( error ) {
428+
function next() {
429429
if ( methods.length ) {
430430
walk( methods );
431431
}

build/tasks/build.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ grunt.registerMultiTask( "zip", "Create a zip file for release", function() {
146146
opts: {
147147
cwd: 'dist'
148148
}
149-
}, function( err, result ) {
149+
}, function( err ) {
150150
if ( err ) {
151151
grunt.log.error( err );
152152
done();

tests/.jshintrc

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@
1111
"onevar": true,
1212
"trailing": true,
1313
"undef": true,
14+
"unused": true,
1415
"predef": [
15-
"addMonths",
1616
"asyncTest",
1717
"container",
1818
"deepEqual",
@@ -29,24 +29,14 @@
2929
"Globalize",
3030
"heightAfter",
3131
"init",
32-
"isNotOpen",
33-
"isOpen",
3432
"modal",
3533
"module",
3634
"moved",
3735
"notEqual",
3836
"offsetAfter",
3937
"offsetBefore",
4038
"ok",
41-
"PROP_NAME",
4239
"QUnit",
43-
"restoreScroll",
44-
"shouldBeDroppable",
45-
"shouldmove",
46-
"shouldNotBeDroppable",
47-
"shouldnotmove",
48-
"shouldnotresize",
49-
"shouldresize",
5040
"start",
5141
"strictEqual",
5242
"stop",

tests/unit/autocomplete/autocomplete_core.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,7 @@ test( "allow form submit on enter when menu is not active", function() {
109109
function arrowsMoveFocus( id, isKeyUp ) {
110110
expect( 1 );
111111

112-
var didMove = false,
113-
element = $( id ).autocomplete({
112+
var element = $( id ).autocomplete({
114113
source: [ "a" ],
115114
delay: 0,
116115
minLength: 0

tests/unit/autocomplete/autocomplete_events.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ $.each([
3939
], "response ui.content" );
4040
ui.content.splice( 0, 1 );
4141
},
42-
open: function( event ) {
42+
open: function() {
4343
ok( menu.is( ":visible" ), "menu open on open" );
4444
},
4545
focus: function( event, ui ) {
@@ -127,7 +127,7 @@ asyncTest( "cancel focus", function() {
127127
element = $( "#autocomplete" ).autocomplete({
128128
delay: 0,
129129
source: data,
130-
focus: function( event, ui ) {
130+
focus: function() {
131131
$( this ).val( customVal );
132132
return false;
133133
}
@@ -146,7 +146,7 @@ asyncTest( "cancel select", function() {
146146
element = $( "#autocomplete" ).autocomplete({
147147
delay: 0,
148148
source: data,
149-
select: function( event, ui ) {
149+
select: function() {
150150
$( this ).val( customVal );
151151
return false;
152152
}

tests/unit/autocomplete/autocomplete_options.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ function autoFocusTest( afValue, focusedLength ) {
3333
autoFocus: afValue,
3434
delay: 0,
3535
source: data,
36-
open: function( event, ui ) {
36+
open: function() {
3737
equal( element.autocomplete( "widget" ).children( ".ui-menu-item:first" ).find( ".ui-state-focus" ).length,
3838
focusedLength, "first item is " + (afValue ? "" : "not") + " auto focused" );
3939
start();

tests/unit/button/button_events.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
22
* button_events.js
33
*/
4-
(function($) {
4+
(function() {
55

66
module("button: events");
77

tests/unit/datepicker/datepicker_core.js

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,31 +12,19 @@ function equalsDate(d1, d2, message) {
1212
equal(d1.toString(), d2.toString(), message);
1313
}
1414

15-
function equalsDateArray(a1, a2, message) {
16-
if (!a1 || !a2) {
17-
ok(false, message + ' - missing dates');
18-
return;
19-
}
20-
a1[0] = (a1[0] ? new Date(a1[0].getFullYear(), a1[0].getMonth(), a1[0].getDate()) : '');
21-
a1[1] = (a1[1] ? new Date(a1[1].getFullYear(), a1[1].getMonth(), a1[1].getDate()) : '');
22-
a2[0] = (a2[0] ? new Date(a2[0].getFullYear(), a2[0].getMonth(), a2[0].getDate()) : '');
23-
a2[1] = (a2[1] ? new Date(a2[1].getFullYear(), a2[1].getMonth(), a2[1].getDate()) : '');
24-
deepEqual(a1, a2, message);
25-
}
26-
27-
function addMonths(date, offset) {
15+
TestHelpers.addMonths = function(date, offset) {
2816
var maxDay = 32 - new Date(date.getFullYear(), date.getMonth() + offset, 32).getDate();
2917
date.setDate(Math.min(date.getDate(), maxDay));
3018
date.setMonth(date.getMonth() + offset);
3119
return date;
32-
}
20+
};
3321

3422
function init(id, options) {
3523
$.datepicker.setDefaults($.datepicker.regional['']);
3624
return $(id).datepicker($.extend({showAnim: ''}, options || {}));
3725
}
3826

39-
var PROP_NAME = 'datepicker';
27+
TestHelpers.PROP_NAME = 'datepicker';
4028

4129
(function($) {
4230

tests/unit/datepicker/datepicker_defaults.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
* datepicker_defaults.js
33
*/
44

5+
/*
56
var datepicker_defaults = {
67
disabled: false
78
};
89
9-
//TestHelpers.commonWidgetTests('datepicker', { defaults: datepicker_defaults });
10+
TestHelpers.commonWidgetTests('datepicker', { defaults: datepicker_defaults });
11+
*/

0 commit comments

Comments
 (0)