Skip to content
This repository has been archived by the owner on Sep 26, 2022. It is now read-only.

Commit

Permalink
Merge pull request #84 from pdehaan/eslint-tweaks
Browse files Browse the repository at this point in the history
Fixing some ESLint warnings and errors
  • Loading branch information
pdehaan committed Sep 8, 2015
2 parents 44cb7a1 + 77e5c15 commit 0cde3c7
Show file tree
Hide file tree
Showing 12 changed files with 33 additions and 32 deletions.
4 changes: 3 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
extends: eslint:recommended

env:
node: true

rules:
global-strict: 0
no-new: 0
no-process-exit: 0
no-shadow: 0
no-new: 0
no-unused-vars: [1, {args: none}]
no-use-before-define: [2, nofunc]
quotes: [1, single]
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ node_js:
sudo: false

before_install:
- npm i -g grunt-cli
- npm i npm@2 -g
- npm i grunt-cli -g
12 changes: 6 additions & 6 deletions client/static/assets/scripts/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ angular.module('LoadsApp')
});
}
else {
alert(messages.join('\n'));
alert(messages.join('\n')); // eslint-disable-line no-alert
}
};

Expand Down Expand Up @@ -189,7 +189,7 @@ angular.module('LoadsApp')
jQuery('#project_id').val(data.project_id);
jQuery('#project_title').val(data.project_title);

console.log('data.project_id', data.project_id);
console.log('data.project_id', data.project_id); // eslint-disable-line no-console

// Create the plans and steps, populate them
jQuery.each(data.plans, function(i) {
Expand All @@ -208,9 +208,9 @@ angular.module('LoadsApp')
// Send to server, redirect to projects listing
generateJSON();
$http.post('/mock/project', projectJSON).success(function (data) {
console.log('bling!');
console.log(data); // eslint-disable-line no-console
}).error(function (err) {
console.error(err);
console.error(err); // eslint-disable-line no-console
});
};

Expand Down Expand Up @@ -261,7 +261,7 @@ angular.module('LoadsApp')
$http.post('/api/comments/', data).success(function (data) {
$scope.resetCommentForm();
}).error(function (err) {
console.error(err);
console.error(err); // eslint-disable-line no-console
});
};

Expand All @@ -275,7 +275,7 @@ angular.module('LoadsApp')
// data.status.endTime = new Date(data.status.endTime);
$scope.details = data;
}).error(function (err) {
console.error(err);
console.error(err); // eslint-disable-line no-console
});
}).controller('ReferenceController', function ($scope, $rootScope) {
$rootScope.title = 'Reference';
Expand Down
4 changes: 2 additions & 2 deletions client/static/assets/scripts/persona.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ $(function () {
currentUser = res.email;
window.location.replace('/');
} else {
alert('Unauthorized');
alert('Unauthorized'); // eslint-disable-line no-alert
navigator.id.logout();
}
}
},
error: function(xhr, status, err) {
console.error(err);
console.error(err); // eslint-disable-line no-console
currentUser = null;
navigator.id.logout();
}
Expand Down
6 changes: 3 additions & 3 deletions client/static/assets/scripts/services.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ angular.module('LoadsApp')

var ws = new WebSocket(WEBSOCKET_URL);
ws.onopen = function () {
console.log('Socket has been opened to %s', WEBSOCKET_URL);
console.log('Socket has been opened to %s', WEBSOCKET_URL); // eslint-disable-line no-console
};
ws.onmessage = function (message) {
$rootScope.$apply(function () {
Expand All @@ -33,8 +33,8 @@ angular.module('LoadsApp')
lastSync: new Date()
};
} catch (err) {
console.error(err);
console.log(message);
console.error(err); // eslint-disable-line no-console
console.log(message); // eslint-disable-line no-console
}
});
};
Expand Down
18 changes: 9 additions & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,34 +6,34 @@
"bugs": "https://github.com/loads/loads-web/issues",
"dependencies": {
"awstypes": "1.0.0",
"bower": "1.4.1",
"bower": "1.5.2",
"browserid-verify": "0.1.2",
"convict": "0.6.1",
"convict": "1.0.1",
"hapi": "8.4.0",
"hapi-auth-cookie": "2.0.0",
"joi": "6.1.0",
"joi": "6.6.1",
"json-mask": "0.3.4",
"mysql": "2.6.1",
"nunjucks-hapi": "1.1.0",
"octonode": "0.6.16",
"promise": "6.1.0",
"promise": "7.0.4",
"remarkable": "1.6.0",
"require-hapiroutes": "0.1.9",
"sequelize": "2.0.5"
"sequelize": "3.6.0"
},
"devDependencies": {
"awsbox": "0.7.0",
"grunt": "0.4.5",
"grunt-contrib-stylus": "0.21.0",
"grunt-eslint": "16.0.0",
"nsp": "1.0.1"
"grunt-contrib-stylus": "0.22.0",
"grunt-eslint": "17.1.0",
"nsp": "1.1.0"
},
"homepage": "https://github.com/loads/loads-web",
"keywords": [
"angular",
"hapi"
],
"license": "Apache",
"license": "Apache-2.0",
"main": "server.js",
"repository": "loads/loads-web",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/login.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module.exports = function (request, reply) {

verify(assertion, audience, function (err, email, response) {
if (err) {
console.error('There was an error : ' + err);
console.error('There was an error : ' + err); // eslint-disable-line no-console
return reply(err);
}

Expand Down
6 changes: 2 additions & 4 deletions server/controllers/project.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
'use strict';

module.exports = function (req, reply) {
// console.log(JSON.stringify(req.payload, null, 2));

if (req.payload.project_id) {
console.log('Updating project id: ', req.payload.project_id);
console.log('Updating project id: ', req.payload.project_id); // eslint-disable-line no-console
reply(0);
} else {
console.log('Creating a new project id');
console.log('Creating a new project id'); // eslint-disable-line no-console
reply(1);
}
};
2 changes: 1 addition & 1 deletion server/controllers/proxy.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function makeMapFunc(prefix) {
port: 8080,
protocol: 'http',
pathname: pathname,
search: request.url.search,
search: request.url.search
});
callback(null, proxyURI);
};
Expand Down
2 changes: 1 addition & 1 deletion server/controllers/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
var Joi = require('joi');
var P = require('promise');

var schema = require('../schema');
// var schema = require('../schema');

var validatep = P.denodeify(Joi.validate);

Expand Down
4 changes: 2 additions & 2 deletions server/db.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ exports.Comment = sequelize.define('Comment', {
// Sync the models to the server and recreate tables.
sequelize.sync({
force: false
}).complete(function (err) {
}).catch(function (err) {
if (err) {
console.error(err);
console.error(err); // eslint-disable-line no-console
process.exit(1);
}
});
2 changes: 1 addition & 1 deletion server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,6 @@ server.register(HapiAuthCookie, function (err) {
server.route(routes);

server.start(function () {
console.log('Hapi server started at %s', server.info.uri);
console.log('Hapi server started at %s', server.info.uri); // eslint-disable-line no-console
});
});

0 comments on commit 0cde3c7

Please sign in to comment.