diff --git a/Gruntfile.js b/Gruntfile.js index 4fc30e1f..24468780 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -3,7 +3,7 @@ // This file is licensed under the MIT License. // License text available at https://opensource.org/licenses/MIT -/*global module:false*/ +/* global module:false */ 'use strict'; module.exports = function(grunt) { // Do not report warnings from unit-tests exercising deprecated paths diff --git a/common/models/user.js b/common/models/user.js index a8c448d9..ca1f8fd8 100644 --- a/common/models/user.js +++ b/common/models/user.js @@ -647,7 +647,7 @@ module.exports = function(User) { return true; } if (plain.length > MAX_PASSWORD_LENGTH) { - err = new Error (g.f('Password too long: %s', plain)); + err = new Error(g.f('Password too long: %s', plain)); err.code = 'PASSWORD_TOO_LONG'; } else { err = new Error(g.f('Invalid password: %s', plain)); diff --git a/lib/connectors/mail.js b/lib/connectors/mail.js index cb3c7e6e..93d916a1 100644 --- a/lib/connectors/mail.js +++ b/lib/connectors/mail.js @@ -29,9 +29,9 @@ function MailConnector(settings) { var transports = settings.transports; - //if transports is not in settings object AND settings.transport exists + // if transports is not in settings object AND settings.transport exists if (!transports && settings.transport) { - //then wrap single transport in an array and assign to transports + // then wrap single transport in an array and assign to transports transports = [settings.transport]; } diff --git a/package.json b/package.json index 9b1f57f2..84a49e09 100644 --- a/package.json +++ b/package.json @@ -65,7 +65,7 @@ "cookie-parser": "^1.3.4", "dirty-chai": "^1.2.2", "es5-shim": "^4.1.0", - "eslint-config-loopback": "^6.0.0", + "eslint-config-loopback": "^7.0.1", "express-session": "^1.14.0", "grunt": "^1.0.1", "grunt-browserify": "^5.0.0", diff --git a/test/karma.conf.js b/test/karma.conf.js index e498b404..f0c4d5d0 100644 --- a/test/karma.conf.js +++ b/test/karma.conf.js @@ -76,7 +76,7 @@ module.exports = function(config) { // to avoid DISCONNECTED messages browserDisconnectTimeout: 10000, // default 2000 browserDisconnectTolerance: 1, // default 0 - browserNoActivityTimeout: 60000, //default 10000 + browserNoActivityTimeout: 60000, // default 10000 // Continuous Integration mode // if true, it capture browsers, run tests and exit diff --git a/test/relations.integration.js b/test/relations.integration.js index c0004c6b..22ca2fcc 100644 --- a/test/relations.integration.js +++ b/test/relations.integration.js @@ -704,7 +704,7 @@ describe('relations - integration', function() { }); it.skip('allows to find related objects via where filter', function(done) { - //TODO https://github.com/strongloop/loopback-datasource-juggler/issues/94 + // TODO https://github.com/strongloop/loopback-datasource-juggler/issues/94 var expectedProduct = this.product; this.get('/api/products?filter[where][categoryId]=' + this.category.id) .expect(200, function(err, res) { @@ -760,7 +760,7 @@ describe('relations - integration', function() { }); it.skip('includes requested related models in `findById`', function(done) { - //TODO https://github.com/strongloop/loopback-datasource-juggler/issues/93 + // TODO https://github.com/strongloop/loopback-datasource-juggler/issues/93 var expectedProduct = this.product; // Note: the URL format is not final var url = '/api/categories/' + this.category.id + '?include=products'; diff --git a/test/user.test.js b/test/user.test.js index 402de3d2..5a8e3bf7 100644 --- a/test/user.test.js +++ b/test/user.test.js @@ -387,7 +387,7 @@ describe('User', function() { it('rejects passwords longer than 72 characters', function(done) { try { User.create({email: 'b@c.com', password: pass73Char}, function(err) { - if (err) return done (err); + if (err) return done(err); done(new Error('User.create() should have thrown an error.')); }); } catch (e) { @@ -410,7 +410,7 @@ describe('User', function() { User.create({email: 'b@c.com', password: pass72Char}, function(err, user) { if (err) return done(err); User.findById(user.id, function(err, userFound) { - if (err) return done (err); + if (err) return done(err); assert(userFound); done(); }); @@ -431,7 +431,7 @@ describe('User', function() { it('rejects password reset when password is more than 72 chars', function(done) { User.create({email: 'b@c.com', password: pass72Char}, function(err) { - if (err) return done (err); + if (err) return done(err); User.resetPassword({email: 'b@c.com', password: pass73Char}, function(err) { assert(err); expect(err).to.match(/Password too long/); @@ -2128,14 +2128,14 @@ describe('User', function() { User.create( {email: 'partial@example.com', password: 'pass1', age: 25}, function(err, partialInstance) { - if (err) return next (err); + if (err) return next(err); userPartial = partialInstance; next(); }); }, function loginPartiallUser(next) { User.login({email: 'partial@example.com', password: 'pass1'}, function(err, ats) { - if (err) return next (err); + if (err) return next(err); next(); }); }, @@ -2144,13 +2144,13 @@ describe('User', function() { {id: userPartial.id}, {age: userPartial.age + 1}, function(err, info) { - if (err) return next (err); + if (err) return next(err); next(); }); }, function verifyTokensOfPartialUser(next) { AccessToken.find({where: {userId: userPartial.id}}, function(err, tokens1) { - if (err) return next (err); + if (err) return next(err); expect(tokens1.length).to.equal(1); next(); }); @@ -2226,14 +2226,14 @@ describe('User', function() { User.create( {email: 'special@example.com', password: 'pass1', name: 'Special'}, function(err, specialInstance) { - if (err) return next (err); + if (err) return next(err); userSpecial = specialInstance; next(); }); }, function loginSpecialUser(next) { User.login({email: 'special@example.com', password: 'pass1'}, function(err, ats) { - if (err) return next (err); + if (err) return next(err); next(); }); }, @@ -2241,13 +2241,13 @@ describe('User', function() { User.updateAll( {name: 'Special'}, {email: 'superspecial@example.com'}, function(err, info) { - if (err) return next (err); + if (err) return next(err); next(); }); }, function verifyTokensOfSpecialUser(next) { AccessToken.find({where: {userId: userSpecial.id}}, function(err, tokens1) { - if (err) return done (err); + if (err) return done(err); expect(tokens1.length, 'tokens - special user tokens').to.equal(0); next(); }); @@ -2350,14 +2350,14 @@ describe('User', function() { async.series([ function updateUser(next) { userInstance.updateAttribute('email', NEW_EMAIL, function(err, info) { - if (err) return next (err); + if (err) return next(err); assert.equal(info.email, NEW_EMAIL); next(); }); }, function findUser(next) { User.findById(userInstance.id, function(err, info) { - if (err) return next (err); + if (err) return next(err); assert.equal(info.email, NEW_EMAIL); assert.equal(info.emailVerified, false); next(); @@ -2372,14 +2372,14 @@ describe('User', function() { async.series([ function updateUser(next) { userInstance.updateAttribute('email', NEW_EMAIL, function(err, info) { - if (err) return next (err); + if (err) return next(err); assert.equal(info.email, NEW_EMAIL); next(); }); }, function findUser(next) { User.findById(userInstance.id, function(err, info) { - if (err) return next (err); + if (err) return next(err); assert.equal(info.email, NEW_EMAIL); assert.equal(info.emailVerified, true); next(); @@ -2394,14 +2394,14 @@ describe('User', function() { async.series([ function updateUser(next) { userInstance.updateAttribute('realm', 'test', function(err, info) { - if (err) return next (err); + if (err) return next(err); assert.equal(info.realm, 'test'); next(); }); }, function findUser(next) { User.findById(userInstance.id, function(err, info) { - if (err) return next (err); + if (err) return next(err); assert.equal(info.realm, 'test'); assert.equal(info.emailVerified, true); next(); @@ -2431,7 +2431,7 @@ describe('User', function() { var email = validCredentialsEmailVerified.email; User.resetPassword({email: email}, function(err, info) { - if (err) return done (err); + if (err) return done(err); done(); }); }); @@ -2445,7 +2445,7 @@ describe('User', function() { assert(err); assert.equal(err.code, 'RESET_FAILED_EMAIL_NOT_VERIFIED'); assert.equal(err.statusCode, 401); - done (); + done(); }); }); @@ -2455,7 +2455,7 @@ describe('User', function() { var email = validCredentialsEmail; User.resetPassword({email: email}, function(err) { - if (err) return done (err); + if (err) return done(err); done(); }); });