Skip to content

Commit 95d1aea

Browse files
committed
chore(travis): re-enable jshint
1 parent 6facb8c commit 95d1aea

27 files changed

+197
-194
lines changed

.jshintrc

+1-11
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,3 @@
11
{
2-
"expr": true,
3-
"browser": true,
4-
"multistr": true,
5-
"globals": {
6-
"jQuery": true,
7-
"ionic": true,
8-
"angular": true,
9-
"console": true,
10-
"module": true,
11-
"document": true
12-
}
2+
"expr": true
133
}

gulpfile.js

+10-6
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ if (IS_RELEASE_BUILD) {
4848

4949
gulp.task('default', ['build']);
5050
gulp.task('build', ['bundle', 'sass']);
51+
gulp.task('validate', ['jshint', 'ddescribe-iit', 'karma']);
5152

5253
gulp.task('docs', function(done) {
5354
var docVersion = argv['doc-version'];
@@ -113,18 +114,21 @@ gulp.task('bundle', [
113114
});
114115

115116
gulp.task('jshint', function() {
116-
return gulp.src(['js/**/*.js', 'test/**/*.js'])
117+
return gulp.src(['js/**/*.js'])
117118
.pipe(jshint('.jshintrc'))
118-
.pipe(jshint.reporter('jshint-stylish'));
119+
.pipe(jshint.reporter(require('jshint-summary')({
120+
fileColCol: ',bold',
121+
positionCol: ',bold',
122+
codeCol: 'green,bold',
123+
reasonCol: 'cyan'
124+
})))
125+
.pipe(jshint.reporter('fail'));
119126
});
120127

121128
gulp.task('ddescribe-iit', function() {
122129
return gulp.src(['test/**/*.js', 'js/**/*.js'])
123130
.pipe(notContains([
124-
'ddescribe',
125-
'iit',
126-
'xit',
127-
'xdescribe'
131+
'ddescribe', 'iit', 'xit', 'xdescribe'
128132
]));
129133
});
130134

js/angular/directive/menuToggle.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@ IonicModule
3636
});
3737
}
3838
};
39-
}])
39+
}]);
4040

js/angular/directive/slideBox.js

+4-4
Original file line numberDiff line numberDiff line change
@@ -119,10 +119,10 @@ function($timeout, $compile, $ionicSlideBoxDelegate) {
119119
slider.load();
120120
});
121121
}],
122-
template: '<div class="slider">\
123-
<div class="slider-slides" ng-transclude>\
124-
</div>\
125-
</div>',
122+
template: '<div class="slider">' +
123+
'<div class="slider-slides" ng-transclude>' +
124+
'</div>' +
125+
'</div>',
126126

127127
link: function($scope, $element, $attr, slideBoxCtrl) {
128128
// If the pager should show, append it to the slide box

js/animation/gl-matrix.js

+54-54
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ vec2.str = function (a) {
627627
if(typeof(exports) !== 'undefined') {
628628
exports.vec2 = vec2;
629629
}
630-
;
630+
631631
/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
632632
633633
Redistribution and use in source and binary forms, with or without modification,
@@ -1120,23 +1120,23 @@ vec3.transformQuat = function(out, a, q) {
11201120
* @returns {vec3} out
11211121
*/
11221122
vec3.rotateX = function(out, a, b, c){
1123-
var p = [], r=[];
1124-
//Translate point to the origin
1125-
p[0] = a[0] - b[0];
1126-
p[1] = a[1] - b[1];
1127-
p[2] = a[2] - b[2];
1123+
var p = [], r=[];
1124+
//Translate point to the origin
1125+
p[0] = a[0] - b[0];
1126+
p[1] = a[1] - b[1];
1127+
p[2] = a[2] - b[2];
11281128

1129-
//perform rotation
1130-
r[0] = p[0];
1131-
r[1] = p[1]*Math.cos(c) - p[2]*Math.sin(c);
1132-
r[2] = p[1]*Math.sin(c) + p[2]*Math.cos(c);
1129+
//perform rotation
1130+
r[0] = p[0];
1131+
r[1] = p[1]*Math.cos(c) - p[2]*Math.sin(c);
1132+
r[2] = p[1]*Math.sin(c) + p[2]*Math.cos(c);
11331133

1134-
//translate to correct position
1135-
out[0] = r[0] + b[0];
1136-
out[1] = r[1] + b[1];
1137-
out[2] = r[2] + b[2];
1134+
//translate to correct position
1135+
out[0] = r[0] + b[0];
1136+
out[1] = r[1] + b[1];
1137+
out[2] = r[2] + b[2];
11381138

1139-
return out;
1139+
return out;
11401140
};
11411141

11421142
/*
@@ -1148,23 +1148,23 @@ vec3.rotateX = function(out, a, b, c){
11481148
* @returns {vec3} out
11491149
*/
11501150
vec3.rotateY = function(out, a, b, c){
1151-
var p = [], r=[];
1152-
//Translate point to the origin
1153-
p[0] = a[0] - b[0];
1154-
p[1] = a[1] - b[1];
1155-
p[2] = a[2] - b[2];
1151+
var p = [], r=[];
1152+
//Translate point to the origin
1153+
p[0] = a[0] - b[0];
1154+
p[1] = a[1] - b[1];
1155+
p[2] = a[2] - b[2];
11561156

1157-
//perform rotation
1158-
r[0] = p[2]*Math.sin(c) + p[0]*Math.cos(c);
1159-
r[1] = p[1];
1160-
r[2] = p[2]*Math.cos(c) - p[0]*Math.sin(c);
1157+
//perform rotation
1158+
r[0] = p[2]*Math.sin(c) + p[0]*Math.cos(c);
1159+
r[1] = p[1];
1160+
r[2] = p[2]*Math.cos(c) - p[0]*Math.sin(c);
11611161

1162-
//translate to correct position
1163-
out[0] = r[0] + b[0];
1164-
out[1] = r[1] + b[1];
1165-
out[2] = r[2] + b[2];
1162+
//translate to correct position
1163+
out[0] = r[0] + b[0];
1164+
out[1] = r[1] + b[1];
1165+
out[2] = r[2] + b[2];
11661166

1167-
return out;
1167+
return out;
11681168
};
11691169

11701170
/*
@@ -1176,23 +1176,23 @@ vec3.rotateY = function(out, a, b, c){
11761176
* @returns {vec3} out
11771177
*/
11781178
vec3.rotateZ = function(out, a, b, c){
1179-
var p = [], r=[];
1180-
//Translate point to the origin
1181-
p[0] = a[0] - b[0];
1182-
p[1] = a[1] - b[1];
1183-
p[2] = a[2] - b[2];
1179+
var p = [], r=[];
1180+
//Translate point to the origin
1181+
p[0] = a[0] - b[0];
1182+
p[1] = a[1] - b[1];
1183+
p[2] = a[2] - b[2];
11841184

1185-
//perform rotation
1186-
r[0] = p[0]*Math.cos(c) - p[1]*Math.sin(c);
1187-
r[1] = p[0]*Math.sin(c) + p[1]*Math.cos(c);
1188-
r[2] = p[2];
1185+
//perform rotation
1186+
r[0] = p[0]*Math.cos(c) - p[1]*Math.sin(c);
1187+
r[1] = p[0]*Math.sin(c) + p[1]*Math.cos(c);
1188+
r[2] = p[2];
11891189

1190-
//translate to correct position
1191-
out[0] = r[0] + b[0];
1192-
out[1] = r[1] + b[1];
1193-
out[2] = r[2] + b[2];
1190+
//translate to correct position
1191+
out[0] = r[0] + b[0];
1192+
out[1] = r[1] + b[1];
1193+
out[2] = r[2] + b[2];
11941194

1195-
return out;
1195+
return out;
11961196
};
11971197

11981198
/**
@@ -1249,7 +1249,7 @@ vec3.str = function (a) {
12491249
if(typeof(exports) !== 'undefined') {
12501250
exports.vec3 = vec3;
12511251
}
1252-
;
1252+
12531253
/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
12541254
12551255
Redistribution and use in source and binary forms, with or without modification,
@@ -1774,7 +1774,7 @@ vec4.str = function (a) {
17741774
if(typeof(exports) !== 'undefined') {
17751775
exports.vec4 = vec4;
17761776
}
1777-
;
1777+
17781778
/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
17791779
17801780
Redistribution and use in source and binary forms, with or without modification,
@@ -2017,7 +2017,7 @@ mat2.str = function (a) {
20172017
* @returns {Number} Frobenius norm
20182018
*/
20192019
mat2.frob = function (a) {
2020-
return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2)))
2020+
return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2)));
20212021
};
20222022

20232023
/**
@@ -2039,7 +2039,7 @@ mat2.LDU = function (L, D, U, a) {
20392039
if(typeof(exports) !== 'undefined') {
20402040
exports.mat2 = mat2;
20412041
}
2042-
;
2042+
20432043
/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
20442044
20452045
Redistribution and use in source and binary forms, with or without modification,
@@ -2291,13 +2291,13 @@ mat2d.str = function (a) {
22912291
* @returns {Number} Frobenius norm
22922292
*/
22932293
mat2d.frob = function (a) {
2294-
return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + 1))
2294+
return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + 1));
22952295
};
22962296

22972297
if(typeof(exports) !== 'undefined') {
22982298
exports.mat2d = mat2d;
22992299
}
2300-
;
2300+
23012301
/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
23022302
23032303
Redistribution and use in source and binary forms, with or without modification,
@@ -2781,14 +2781,14 @@ mat3.str = function (a) {
27812781
* @returns {Number} Frobenius norm
27822782
*/
27832783
mat3.frob = function (a) {
2784-
return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2)))
2784+
return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2)));
27852785
};
27862786

27872787

27882788
if(typeof(exports) !== 'undefined') {
27892789
exports.mat3 = mat3;
27902790
}
2791-
;
2791+
27922792
/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
27932793
27942794
Redistribution and use in source and binary forms, with or without modification,
@@ -3693,14 +3693,14 @@ mat4.str = function (a) {
36933693
* @returns {Number} Frobenius norm
36943694
*/
36953695
mat4.frob = function (a) {
3696-
return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2) ))
3696+
return(Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2) + Math.pow(a[2], 2) + Math.pow(a[3], 2) + Math.pow(a[4], 2) + Math.pow(a[5], 2) + Math.pow(a[6], 2) + Math.pow(a[6], 2) + Math.pow(a[7], 2) + Math.pow(a[8], 2) + Math.pow(a[9], 2) + Math.pow(a[10], 2) + Math.pow(a[11], 2) + Math.pow(a[12], 2) + Math.pow(a[13], 2) + Math.pow(a[14], 2) + Math.pow(a[15], 2) ));
36973697
};
36983698

36993699

37003700
if(typeof(exports) !== 'undefined') {
37013701
exports.mat4 = mat4;
37023702
}
3703-
;
3703+
37043704
/* Copyright (c) 2013, Brandon Jones, Colin MacKenzie IV. All rights reserved.
37053705
37063706
Redistribution and use in source and binary forms, with or without modification,
@@ -4230,7 +4230,7 @@ quat.str = function (a) {
42304230
if(typeof(exports) !== 'undefined') {
42314231
exports.quat = quat;
42324232
}
4233-
;
4233+
42344234

42354235

42364236

js/animation/timing-functions.js

+5-5
Original file line numberDiff line numberDiff line change
@@ -8,27 +8,27 @@
88
'linear': function(duration) {
99
return function(t) {
1010
return ionic.Animation.Bezier.linear(t, duration);
11-
}
11+
};
1212
},
1313
'ease': function(duration) {
1414
return function(t) {
1515
return ionic.Animation.Bezier.ease(t, duration);
16-
}
16+
};
1717
},
1818
'ease-in': function(duration) {
1919
return function(t) {
2020
return ionic.Animation.Bezier.easeIn(t, duration);
21-
}
21+
};
2222
},
2323
'ease-out': function(duration) {
2424
return function(t) {
2525
return ionic.Animation.Bezier.easeOut(t, duration);
26-
}
26+
};
2727
},
2828
'ease-in-out': function(duration) {
2929
return function(t) {
3030
return ionic.Animation.Bezier.easeInOut(t, duration);
31-
}
31+
};
3232
}
3333
};
3434
})(window);

js/utils/utils.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117
// `parent`'s constructor function.
118118
var Surrogate = function(){ this.constructor = child; };
119119
Surrogate.prototype = parent.prototype;
120-
child.prototype = new Surrogate;
120+
child.prototype = new Surrogate();
121121

122122
// Add prototype properties (instance properties) to the subclass,
123123
// if supplied.

js/utils/viewport.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ function viewportLoadTag() {
2525
var props = viewportTag.content.toLowerCase().replace(/\s+/g, '').split(',');
2626
var keyValue;
2727
for(x=0; x<props.length; x++) {
28-
if(props[x] != '') {
28+
if(props[x]) {
2929
keyValue = props[x].split('=');
3030
viewportProperties[ keyValue[0] ] = (keyValue.length > 1 ? keyValue[1] : '_');
3131
}

js/views/listView.js

+4-3
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192

193193
ReorderDrag.prototype._moveElement = function(e) {
194194
var y = e.gesture.center.pageY -
195-
this._currentDrag.elementHeight +
195+
this._currentDrag.elementHeight +
196196
this.scrollView.getValues().top -
197197
this.listEl.offsetTop;
198198
this.el.style[ionic.CSS.TRANSFORM] = 'translate3d(0, '+y+'px, 0)';
@@ -457,10 +457,11 @@
457457
this._isDragging = false;
458458

459459
var lastDragOp = this._lastDragOp;
460+
var item;
460461

461462
// Check if this is a reorder drag
462463
if(ionic.DomUtil.getParentOrSelfWithClass(e.target, ITEM_REORDER_BTN_CLASS) && (e.gesture.direction == 'up' || e.gesture.direction == 'down')) {
463-
var item = this._getItem(e.target);
464+
item = this._getItem(e.target);
464465

465466
if(item) {
466467
this._dragOp = new ReorderDrag({
@@ -481,7 +482,7 @@
481482
else if(!this._didDragUpOrDown && (e.gesture.direction == 'left' || e.gesture.direction == 'right') && Math.abs(e.gesture.deltaX) > 5) {
482483

483484
// Make sure this is an item with buttons
484-
var item = this._getItem(e.target);
485+
item = this._getItem(e.target);
485486
if(item && item.querySelector('.item-options')) {
486487
this._dragOp = new SlideDrag({ el: this.el, canSwipe: this.canSwipe });
487488
this._dragOp.start(e);

0 commit comments

Comments
 (0)