Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ESLint #16

Merged
merged 23 commits into from Nov 15, 2016
Merged

Add ESLint #16

merged 23 commits into from Nov 15, 2016

Conversation

danielbayerlein
Copy link
Collaborator

See #13

@danielbayerlein
Copy link
Collaborator Author

@chrishelgert Can you please review my changes?

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 54.118% when pulling 914450b on linter into 49678f4 on master.

@chrishelgert
Copy link

Sure, will look later @ it :)

Copy link

@chrishelgert chrishelgert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@danielbayerlein please check the review-comments ;) the rest looks fine

@@ -7,7 +7,8 @@ describe('helpers', () => {
const spans = defaultConfig.spans;

beforeEach(() => {
spans.forEach((span) => {
spans.forEach((currentSpan) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should have a different meaning - maybe make spans a let and use map to iterate over the spans and clear the responses:

let spans = defaultConfig.spans;
// ....
spans = spans.map((currentSpan) => {
  const span = currentSpan;
  span.responses = [];
  return span;
});
// ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done


// Add the "/return-status/{statusCode}" route
server.route({
method: 'GET',
path: '/return-status/{statusCode}',
handler: function (request, reply) {
handler: function handler(request, reply) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no arrow-function and parse the statusCode initial?

handler: (request, reply) => {
  const statusCode = parseInt(request.params.statusCode, 10);
  return reply(statusCode).code(statusCode);
};

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@@ -16,7 +14,8 @@ module.exports = (server, spans) => {
});
});

spans.forEach((span) => {
spans.forEach((currentSpan) => {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same as above with map or?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

spans is not reused. I think it's 👌

@@ -5,50 +5,50 @@ const onHeadersListener = require('./helpers/on-headers-listener');
const socketIoInit = require('./helpers/socket-io-init');

// hapi.js plugin register function
var middlewareWrapper = function (server, options, next) {
options = validate(options);
const middlewareWrapper = function middlewareWrapper(server, options, next) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why no arrow-function?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

@danielbayerlein
Copy link
Collaborator Author

@chrishelgert Thanks for the review 👍

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.8%) to 54.118% when pulling 439b9e5 on linter into 49678f4 on master.

@danielbayerlein danielbayerlein merged commit 66c5c68 into master Nov 15, 2016
@danielbayerlein danielbayerlein deleted the linter branch November 15, 2016 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants