Permalink
Browse files

jshint appeasements

  • Loading branch information...
lovett committed Aug 20, 2014
1 parent 3b6438f commit c8afc94dd6fe309bd7f4e29f1dc132ad148f0df5
Showing with 29 additions and 31 deletions.
  1. +3 −3 .jshintrc-browser
  2. +1 −0 feedfetcher/index.js
  3. +1 −1 server/index.js
  4. +5 −5 src/app.js
  5. +11 −16 src/controllers.js
  6. +8 −6 src/services.js
View
@@ -1,7 +1,7 @@
{
"globals": {
"angular": false,
- "moment": false,
+ "saveAs": false,
"$": false,
"_": false
},
@@ -28,8 +28,8 @@
"trailing": true,
"maxparams": 10,
"maxdepth": 4,
- "maxstatements": 15,
- "maxcomplexity": 6,
+ "maxstatements": 30,
+ "maxcomplexity": 10,
"asi": false,
"boss": false,
"debug": false,
View
@@ -1,3 +1,4 @@
+/*jshint camelcase:false */
var world = require('../world');
var logger = world.logger.child({source: 'feedfetcher'});
var dispatcher = new world.events.EventEmitter();
View
@@ -254,7 +254,7 @@ var feedUnsubscribe = function (request, response, next) {
multi.srem(world.keys.feedListKey(request.user.id), feedId);
// Remove the user from the feed's user list
- key = world.keys.feedSubscribersKey(feedId);
+ var key = world.keys.feedSubscribersKey(feedId);
multi.srem(key, request.user.id);
// Update the total subscriptions to this feed
View
@@ -73,11 +73,11 @@ app.filter('reldate', function () {
var delta = (now - d) / 86400 / 1000;
- if (delta == -1) {
+ if (delta === -1) {
return 'tomorrow';
- } else if (delta == 0) {
+ } else if (delta === 0) {
return 'today';
- } else if (delta == 1) {
+ } else if (delta === 1) {
return 'yesterday';
} else {
return when;
@@ -93,7 +93,7 @@ app.directive('fileUpload', function () {
scope: { fileUpload: '&' },
template: '<input type="file" />',
replace: true,
- link: function (scope, element, attributes) {
+ link: function (scope, element) {
element.bind('change', function () {
var fileList = element[0].files;
if (fileList) {
@@ -102,7 +102,7 @@ app.directive('fileUpload', function () {
angular.element(element[0]).val(null);
});
}
- }
+ };
});
app.run(function () {
View
@@ -24,7 +24,7 @@ appControllers.controller('LogoutController', ['$scope', '$location', 'AuthServi
AuthService.logout({}, {
'action': 'logout',
'token': token
- }, function (data) {
+ }, function () {
$scope.user.forgetToken();
});
}
@@ -35,7 +35,7 @@ appControllers.controller('LogoutController', ['$scope', '$location', 'AuthServi
appControllers.controller('LoginController', ['$scope', '$location', 'AuthService', function ($scope, $location, AuthService) {
'use strict';
- var token, loginSuccess, loginFailure;
+ var loginSuccess, loginFailure;
$scope.remember = true;
@@ -69,7 +69,7 @@ appControllers.controller('LoginController', ['$scope', '$location', 'AuthServic
appControllers.controller('SignupController', ['$scope', '$location', 'SignupService', function ($scope, $location, SignupService) {
'use strict';
- var signupSuccess, signupFailure
+ var signupSuccess, signupFailure;
signupSuccess = function () {
$location.path('/');
@@ -91,7 +91,7 @@ appControllers.controller('SignupController', ['$scope', '$location', 'SignupSer
'username': $scope.signup.username,
'password': $scope.signup.password
}, signupSuccess, signupFailure);
- }
+ };
}]);
@@ -185,22 +185,17 @@ appControllers.controller('FeedController', ['$rootScope', '$scope', '$route', '
reschedule: Date.now()
}, function (response) {
feed.nextCheck = response.nextCheck;
- console.log(response);
- }, function (err) {
- console.log(err);
});
- }
+ };
$scope.export = function () {
List.export({name: 'feeds'}, {}, function (response) {
// Safari 7 will not trigger a file download. See
// https://github.com/eligrey/FileSaver.js/issues/12#issuecomment-47247096
- var blob = new Blob([response.xml], {type: "text/xml;charset=utf-8"});
- saveAs(blob, "feeds.xml");
- }, function (err) {
- console.log(err);
+ var blob = new Blob([response.xml], {type: 'text/xml;charset=utf-8'});
+ saveAs(blob, 'feeds.xml');
});
- }
+ };
$scope.importPhase = 'start';
@@ -220,13 +215,13 @@ appControllers.controller('FeedController', ['$rootScope', '$scope', '$route', '
subscribe: subscriptions
}, function (response) {
populate(response);
- $scope.importMessage = 'Imported ' + response.feeds.length + ((response.feeds.length == 1)? ' feed':' feeds') + '.';
+ $scope.importMessage = 'Imported ' + response.feeds.length + ((response.feeds.length === 1)? ' feed':' feeds') + '.';
$scope.importPhase = 'result';
}, function (data) {
$scope.addMessage = data.data.message;
});
});
- }
+ };
}]);
appControllers.controller('ListController', ['$rootScope', '$scope', '$routeParams', '$route', '$location', 'List', function ($rootScope, $scope, $routeParams, $route, $location, List) {
@@ -292,7 +287,7 @@ appControllers.controller('ListController', ['$rootScope', '$scope', '$routePara
} else {
$rootScope.showPager = ($rootScope.pageCount > 1);
- if ($rootScope.pageCount == 0) {
+ if ($rootScope.pageCount === 0) {
$rootScope.prevLink = null;
} else {
$rootScope.prevLink = '/entries/' + $routeParams.name + '/' + ($rootScope.page - 1);
View
@@ -9,10 +9,10 @@ appServices.factory('List', ['$resource', function ($resource) {
'Accept': 'text/xml'
},
isArray: false,
- transformResponse: function (data, headers) {
+ transformResponse: function (data) {
return {
xml: data
- }
+ };
}
},
get: {
@@ -78,10 +78,11 @@ appServices.factory('UserService', [function () {
localStorage.removeItem('token');
sessionStorage.removeItem('token');
}
- }
+ };
}]);
appServices.factory('HttpInterceptService', ['$q', '$location', 'UserService', function ($q, $location, UserService) {
+ 'use strict';
var interceptor = {
'request': function (config) {
config.headers['X-Auth'] = UserService.getToken();
@@ -94,11 +95,12 @@ appServices.factory('HttpInterceptService', ['$q', '$location', 'UserService', f
return $q.reject(response);
}
- }
+ };
return interceptor;
}]);
appServices.factory('Reader', ['$window', '$q', function ($window, $q) {
+ 'use strict';
return {
readXML: function (fileList) {
var deferred = $q.defer();
@@ -114,11 +116,11 @@ appServices.factory('Reader', ['$window', '$q', function ($window, $q) {
var parser = new $window.DOMParser();
var dom = parser.parseFromString(reader.result, file.type);
deferred.resolve(dom);
- }
+ };
reader.readAsText(file);
});
return deferred.promise;
}
- }
+ };
}]);

0 comments on commit c8afc94

Please sign in to comment.