diff --git a/.jshintrc b/.jshintrc deleted file mode 100644 index 30d7ea440..000000000 --- a/.jshintrc +++ /dev/null @@ -1,8 +0,0 @@ -{ - "node": true, - "browser": true, - "unused": true, - "globalstrict": true, - "predef": [ "angular", "$" ], - "esnext": true -} diff --git a/package.json b/package.json index 899daeaa5..8ff6e9b24 100644 --- a/package.json +++ b/package.json @@ -24,5 +24,10 @@ "gulp-sourcemaps": "^2.6.4", "rimraf": "^2.6.2", "yargs": "^11.0.0" + }, + "eslintConfig": { + "env": { + "browser": true + } } } diff --git a/src/js/client.js b/src/js/client.js index bae1d5540..9d60cb890 100644 --- a/src/js/client.js +++ b/src/js/client.js @@ -1,8 +1,9 @@ 'use strict'; -/* global angular */ -/* global EventSource */ -/* global asyncForEach */ +/* global $:false */ +/* global angular:false */ +/* global EventSource:false */ +/* global asyncForEach:false */ angular.module('Application').service('Client', ['$http', '$interval', 'md5', 'Notification', function ($http, $interval, md5, Notification) { var client = null; diff --git a/src/js/index.js b/src/js/index.js index a31ea6988..076be3cc7 100644 --- a/src/js/index.js +++ b/src/js/index.js @@ -3,6 +3,7 @@ /* global angular:false */ /* global showdown:false */ /* global moment:false */ +/* global $:false */ // deal with accessToken in the query, this is passed for example on password reset and account setup upon invite var search = decodeURIComponent(window.location.search).slice(1).split('&').map(function (item) { return item.split('='); }).reduce(function (o, k) { o[k[0]] = k[1]; return o; }, {}); @@ -18,7 +19,7 @@ if (search.accessToken) { } // poor man's async in the global namespace -function asyncForEachParallel(items, handler, callback) { + function asyncForEachParallel(items, handler, callback) { var alreadyDone = 0; var errored = false; @@ -255,7 +256,6 @@ app.filter('installationStateLabel', function() { else if (app.runState === 'pending_stop') return 'Stopping...'; else if (app.runState === 'stopped') return 'Stopped'; else return app.runState; - break; } default: return app.installationState; } @@ -407,8 +407,8 @@ var ACTION_SYSTEM_CRASH = 'system.crash'; app.filter('eventLogSource', function() { return function(eventLog) { var source = eventLog.source; - var data = eventLog.data; - var errorMessage = data.errorMessage; + // var data = eventLog.data; + // var errorMessage = data.errorMessage; var line = ''; // ({{ eventLog.source.ip || eventLog.source.appId }}) @@ -640,7 +640,7 @@ app.run(['$route', '$rootScope', '$location', function ($route, $rootScope, $loc app.directive('ngClickSelect', function () { return { restrict: 'AC', - link: function (scope, element, attrs) { + link: function (scope, element/*, attrs */) { element.bind('click', function () { var selection = window.getSelection(); var range = document.createRange(); diff --git a/src/views/activity.js b/src/views/activity.js index ca3a17041..ba5787581 100644 --- a/src/views/activity.js +++ b/src/views/activity.js @@ -1,5 +1,8 @@ 'use strict'; +/* global angular:false */ +/* global $:false */ + angular.module('Application').controller('ActivityController', ['$scope', '$location', 'Client', function ($scope, $location, Client) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); diff --git a/src/views/apps.js b/src/views/apps.js index b86a4c15d..651c60364 100644 --- a/src/views/apps.js +++ b/src/views/apps.js @@ -1,7 +1,9 @@ 'use strict'; +/* global angular:false */ +/* global $:false */ -angular.module('Application').controller('AppsController', ['$scope', '$location', '$timeout', '$interval', 'Client', 'ngTld', 'AppStore', function ($scope, $location, $timeout, $interval, Client, ngTld, AppStore) { +angular.module('Application').controller('AppsController', ['$scope', '$location', '$timeout', '$interval', 'Client', function ($scope, $location, $timeout, $interval, Client) { $scope.HOST_PORT_MIN = 1024; $scope.HOST_PORT_MAX = 65535; $scope.installedApps = Client.getInstalledApps(); diff --git a/src/views/appstore.js b/src/views/appstore.js index 1522ff358..0f717f2f3 100644 --- a/src/views/appstore.js +++ b/src/views/appstore.js @@ -1,5 +1,8 @@ 'use strict'; +/* global angular:false */ +/* global $:false */ + angular.module('Application').controller('AppStoreController', ['$scope', '$location', '$timeout', '$routeParams', 'Client', 'AppStore', function ($scope, $location, $timeout, $routeParams, Client, AppStore) { Client.onReady(function () { if (!Client.getUserInfo().admin && !Client.getConfig().features.spaces) $location.path('/'); }); @@ -589,7 +592,7 @@ angular.module('Application').controller('AppStoreController', ['$scope', '$loca }); // autofocus if appstore login is shown - $scope.$watch('validAppstoreAccount', function (newValue, oldValue) { + $scope.$watch('validAppstoreAccount', function (newValue/*, oldValue */) { if (!newValue) setTimeout(function () { $('[name=appstoreLoginForm]').find('[autofocus]:first').focus(); }, 1000); }); diff --git a/src/views/backups.js b/src/views/backups.js index 35d08112c..fcede2c3b 100644 --- a/src/views/backups.js +++ b/src/views/backups.js @@ -1,6 +1,9 @@ 'use strict'; -angular.module('Application').controller('BackupsController', ['$scope', '$location', '$rootScope', '$timeout', 'Client', 'AppStore', function ($scope, $location, $rootScope, $timeout, Client, AppStore) { +/* global angular:false */ +/* global $:false */ + +angular.module('Application').controller('BackupsController', ['$scope', '$location', '$rootScope', '$timeout', 'Client', function ($scope, $location, $rootScope, $timeout, Client) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); $scope.config = Client.getConfig(); diff --git a/src/views/domains.js b/src/views/domains.js index 4ad527f9d..dd61bfa60 100644 --- a/src/views/domains.js +++ b/src/views/domains.js @@ -1,8 +1,10 @@ 'use strict'; /* global asyncForEach:false */ +/* global angular:false */ +/* global $:false */ -angular.module('Application').controller('DomainsController', ['$scope', '$location', 'Client', 'ngTld', function ($scope, $location, Client, ngTld) { +angular.module('Application').controller('DomainsController', ['$scope', '$location', 'Client', function ($scope, $location, Client) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); $scope.config = Client.getConfig(); diff --git a/src/views/email.js b/src/views/email.js index 0b453113c..04fe75140 100644 --- a/src/views/email.js +++ b/src/views/email.js @@ -1,5 +1,8 @@ 'use strict'; +/* global angular:false */ +/* global $:false */ + angular.module('Application').controller('EmailController', ['$scope', '$location', '$timeout', '$rootScope', 'Client', function ($scope, $location, $timeout, $rootScope, Client) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); diff --git a/src/views/graphs.js b/src/views/graphs.js index 1e81f0d9f..a20f28edc 100644 --- a/src/views/graphs.js +++ b/src/views/graphs.js @@ -1,7 +1,9 @@ +'use strict'; + /* global Chart:false */ /* global asyncForEach:false */ - -'use strict'; +/* global angular:false */ +/* global $:false */ angular.module('Application').controller('GraphsController', ['$scope', '$location', 'Client', function ($scope, $location, Client) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); diff --git a/src/views/settings.js b/src/views/settings.js index 173c52644..b0a816017 100644 --- a/src/views/settings.js +++ b/src/views/settings.js @@ -1,5 +1,8 @@ 'use strict'; +/* global angular:false */ +/* global $:false */ + angular.module('Application').controller('SettingsController', ['$scope', '$location', '$rootScope', '$timeout', 'Client', 'AppStore', function ($scope, $location, $rootScope, $timeout, Client, AppStore) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); diff --git a/src/views/support.js b/src/views/support.js index 50255c360..41806a6cb 100644 --- a/src/views/support.js +++ b/src/views/support.js @@ -1,5 +1,8 @@ 'use strict'; +/* global angular:false */ +/* global $:false */ + angular.module('Application').controller('SupportController', ['$scope', '$location', 'Client', function ($scope, $location, Client) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); diff --git a/src/views/system.js b/src/views/system.js index d915bf0e0..fd1cc2d6b 100644 --- a/src/views/system.js +++ b/src/views/system.js @@ -1,6 +1,7 @@ 'use strict'; -/* global angular */ +/* global angular:false */ +/* global $:false */ angular.module('Application').controller('SystemController', ['$scope', '$location', '$interval', 'Client', function ($scope, $location, $interval, Client) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); diff --git a/src/views/tokens.js b/src/views/tokens.js index aed542876..7b3d89987 100644 --- a/src/views/tokens.js +++ b/src/views/tokens.js @@ -1,6 +1,9 @@ 'use strict'; -angular.module('Application').controller('TokensController', ['$scope', 'Client', function ($scope, Client) { +/* global angular:false */ +/* global $:false */ + +angular.module('Application').controller('TokensController', ['$scope', '$location', 'Client', function ($scope, $location, Client) { Client.onReady(function () { if (!Client.getUserInfo().admin) $location.path('/'); }); $scope.user = Client.getUserInfo();