Skip to content

Conversation

@bajtos
Copy link
Member

@bajtos bajtos commented Dec 5, 2016

  • eslint ^3.11.1
  • eslint-config-loopback: ^6.0.0
  • fix linter errors (mostly no-undef)

@superkhau or @Amir-61 please review

 - eslint ^3.11.1
 - eslint-config-loopback: ^6.0.0
 - fix linter errors (mostly no-undef)
@bajtos
Copy link
Member Author

bajtos commented Dec 5, 2016

The failed downstream builds are unrelated AFAICT - two timeouts and an SQL error.

// This test written in mocha+should.js
'use strict';

/* global getSchema:false, connectorCapabilities:false */
Copy link
Contributor

Choose a reason for hiding this comment

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

We should fix (ie. not use) these globals at some point. ;) That is outside the scope of this PR though.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with both! Should we create an issue to keep track of this work? I am not sure if this problem important enough, there is no point in creating issues that nobody will work for months.

Copy link
Contributor

Choose a reason for hiding this comment

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

I believe it is important to keep our house as clean as possible and as soon as possible. We should not delay these minor issues for months IMO, but I'll leave that decision up to @ritch. Issue created at #1186 and assigned to @siddhipai

@superkhau superkhau assigned bajtos and unassigned superkhau and Amir-61 Dec 5, 2016
// to guarantee to create it in the same turn of even loop
return self._createSync(model, data, function(err, id) {
if (err) return process.nextTick(function() { cb(err); });
if (err) return process.nextTick(function() { callback(err); });
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not cb? I still prefer cb over callback unless we've decided to do this all over the place.

Copy link
Contributor

Choose a reason for hiding this comment

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

@bajtos @superkhau either one is fine with me; consistency is what I would follow... I did a quick search in lib/connectors/memory.js and it seems most of the methods use callback, so I would personally go for callback in this case; however I agree if I had the option with not lots of callbacks in the file, I would go for cb rather than callback but it is a nitpick.

@superkhau this one actually was a bug since there was no cb in this method and that's why @bajtos changed it to callback.

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm also fine with either -- I would just like some consistency in our codebase instead of both.

Bug makes sense, but I would like the bugfix in a seperate commit at least so we know its unrelated to the ESLint fixes.

Copy link
Member Author

Choose a reason for hiding this comment

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

In this patch, I am fixing undefined cb to the correct callback. Let's keep the discussion and (possibly) the refactoring out of scope of this pull request please.

Copy link
Contributor

Choose a reason for hiding this comment

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

It's a nitpick anyways, 2 commits (one for bug and one for the eslint changes) would've been better for the reviewer to determine WHY the cb/callback thing was changed since the bugfix is not a requirement of ESLint since this PR was for ESLint changes. I'm not saying make a separate PR, just another commit on top of the current changes.

Copy link
Contributor

@Amir-61 Amir-61 left a comment

Choose a reason for hiding this comment

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

LGTM.

// to guarantee to create it in the same turn of even loop
return self._createSync(model, data, function(err, id) {
if (err) return process.nextTick(function() { cb(err); });
if (err) return process.nextTick(function() { callback(err); });
Copy link
Contributor

Choose a reason for hiding this comment

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

@bajtos @superkhau either one is fine with me; consistency is what I would follow... I did a quick search in lib/connectors/memory.js and it seems most of the methods use callback, so I would personally go for callback in this case; however I agree if I had the option with not lots of callbacks in the file, I would go for cb rather than callback but it is a nitpick.

@superkhau this one actually was a bug since there was no cb in this method and that's why @bajtos changed it to callback.

@bajtos bajtos merged commit 80d2264 into master Dec 6, 2016
@bajtos bajtos deleted the update/eslint branch December 6, 2016 09:12
@bajtos bajtos removed the #review label Dec 6, 2016
@bajtos
Copy link
Member Author

bajtos commented Dec 6, 2016

Landed, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants