Upgrade eslint-config to 7.x

This commit is contained in:
Miroslav Bajtoš 2017-01-06 12:12:35 +01:00
parent 12be94e0db
commit 70eecfab70
7 changed files with 28 additions and 28 deletions

View File

@ -3,7 +3,7 @@
// This file is licensed under the MIT License. // This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT // License text available at https://opensource.org/licenses/MIT
/*global module:false*/ /* global module:false */
'use strict'; 'use strict';
module.exports = function(grunt) { module.exports = function(grunt) {
// Do not report warnings from unit-tests exercising deprecated paths // Do not report warnings from unit-tests exercising deprecated paths

View File

@ -647,7 +647,7 @@ module.exports = function(User) {
return true; return true;
} }
if (plain.length > MAX_PASSWORD_LENGTH) { 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'; err.code = 'PASSWORD_TOO_LONG';
} else { } else {
err = new Error(g.f('Invalid password: %s', plain)); err = new Error(g.f('Invalid password: %s', plain));

View File

@ -29,9 +29,9 @@ function MailConnector(settings) {
var transports = settings.transports; 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) { 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]; transports = [settings.transport];
} }

View File

@ -65,7 +65,7 @@
"cookie-parser": "^1.3.4", "cookie-parser": "^1.3.4",
"dirty-chai": "^1.2.2", "dirty-chai": "^1.2.2",
"es5-shim": "^4.1.0", "es5-shim": "^4.1.0",
"eslint-config-loopback": "^6.0.0", "eslint-config-loopback": "^7.0.1",
"express-session": "^1.14.0", "express-session": "^1.14.0",
"grunt": "^1.0.1", "grunt": "^1.0.1",
"grunt-browserify": "^5.0.0", "grunt-browserify": "^5.0.0",

View File

@ -76,7 +76,7 @@ module.exports = function(config) {
// to avoid DISCONNECTED messages // to avoid DISCONNECTED messages
browserDisconnectTimeout: 10000, // default 2000 browserDisconnectTimeout: 10000, // default 2000
browserDisconnectTolerance: 1, // default 0 browserDisconnectTolerance: 1, // default 0
browserNoActivityTimeout: 60000, //default 10000 browserNoActivityTimeout: 60000, // default 10000
// Continuous Integration mode // Continuous Integration mode
// if true, it capture browsers, run tests and exit // if true, it capture browsers, run tests and exit

View File

@ -704,7 +704,7 @@ describe('relations - integration', function() {
}); });
it.skip('allows to find related objects via where filter', function(done) { 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; var expectedProduct = this.product;
this.get('/api/products?filter[where][categoryId]=' + this.category.id) this.get('/api/products?filter[where][categoryId]=' + this.category.id)
.expect(200, function(err, res) { .expect(200, function(err, res) {
@ -760,7 +760,7 @@ describe('relations - integration', function() {
}); });
it.skip('includes requested related models in `findById`', function(done) { 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; var expectedProduct = this.product;
// Note: the URL format is not final // Note: the URL format is not final
var url = '/api/categories/' + this.category.id + '?include=products'; var url = '/api/categories/' + this.category.id + '?include=products';

View File

@ -387,7 +387,7 @@ describe('User', function() {
it('rejects passwords longer than 72 characters', function(done) { it('rejects passwords longer than 72 characters', function(done) {
try { try {
User.create({email: 'b@c.com', password: pass73Char}, function(err) { 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.')); done(new Error('User.create() should have thrown an error.'));
}); });
} catch (e) { } catch (e) {
@ -410,7 +410,7 @@ describe('User', function() {
User.create({email: 'b@c.com', password: pass72Char}, function(err, user) { User.create({email: 'b@c.com', password: pass72Char}, function(err, user) {
if (err) return done(err); if (err) return done(err);
User.findById(user.id, function(err, userFound) { User.findById(user.id, function(err, userFound) {
if (err) return done (err); if (err) return done(err);
assert(userFound); assert(userFound);
done(); done();
}); });
@ -431,7 +431,7 @@ describe('User', function() {
it('rejects password reset when password is more than 72 chars', function(done) { it('rejects password reset when password is more than 72 chars', function(done) {
User.create({email: 'b@c.com', password: pass72Char}, function(err) { 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) { User.resetPassword({email: 'b@c.com', password: pass73Char}, function(err) {
assert(err); assert(err);
expect(err).to.match(/Password too long/); expect(err).to.match(/Password too long/);
@ -2128,14 +2128,14 @@ describe('User', function() {
User.create( User.create(
{email: 'partial@example.com', password: 'pass1', age: 25}, {email: 'partial@example.com', password: 'pass1', age: 25},
function(err, partialInstance) { function(err, partialInstance) {
if (err) return next (err); if (err) return next(err);
userPartial = partialInstance; userPartial = partialInstance;
next(); next();
}); });
}, },
function loginPartiallUser(next) { function loginPartiallUser(next) {
User.login({email: 'partial@example.com', password: 'pass1'}, function(err, ats) { User.login({email: 'partial@example.com', password: 'pass1'}, function(err, ats) {
if (err) return next (err); if (err) return next(err);
next(); next();
}); });
}, },
@ -2144,13 +2144,13 @@ describe('User', function() {
{id: userPartial.id}, {id: userPartial.id},
{age: userPartial.age + 1}, {age: userPartial.age + 1},
function(err, info) { function(err, info) {
if (err) return next (err); if (err) return next(err);
next(); next();
}); });
}, },
function verifyTokensOfPartialUser(next) { function verifyTokensOfPartialUser(next) {
AccessToken.find({where: {userId: userPartial.id}}, function(err, tokens1) { 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); expect(tokens1.length).to.equal(1);
next(); next();
}); });
@ -2226,14 +2226,14 @@ describe('User', function() {
User.create( User.create(
{email: 'special@example.com', password: 'pass1', name: 'Special'}, {email: 'special@example.com', password: 'pass1', name: 'Special'},
function(err, specialInstance) { function(err, specialInstance) {
if (err) return next (err); if (err) return next(err);
userSpecial = specialInstance; userSpecial = specialInstance;
next(); next();
}); });
}, },
function loginSpecialUser(next) { function loginSpecialUser(next) {
User.login({email: 'special@example.com', password: 'pass1'}, function(err, ats) { User.login({email: 'special@example.com', password: 'pass1'}, function(err, ats) {
if (err) return next (err); if (err) return next(err);
next(); next();
}); });
}, },
@ -2241,13 +2241,13 @@ describe('User', function() {
User.updateAll( User.updateAll(
{name: 'Special'}, {name: 'Special'},
{email: 'superspecial@example.com'}, function(err, info) { {email: 'superspecial@example.com'}, function(err, info) {
if (err) return next (err); if (err) return next(err);
next(); next();
}); });
}, },
function verifyTokensOfSpecialUser(next) { function verifyTokensOfSpecialUser(next) {
AccessToken.find({where: {userId: userSpecial.id}}, function(err, tokens1) { 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); expect(tokens1.length, 'tokens - special user tokens').to.equal(0);
next(); next();
}); });
@ -2350,14 +2350,14 @@ describe('User', function() {
async.series([ async.series([
function updateUser(next) { function updateUser(next) {
userInstance.updateAttribute('email', NEW_EMAIL, function(err, info) { userInstance.updateAttribute('email', NEW_EMAIL, function(err, info) {
if (err) return next (err); if (err) return next(err);
assert.equal(info.email, NEW_EMAIL); assert.equal(info.email, NEW_EMAIL);
next(); next();
}); });
}, },
function findUser(next) { function findUser(next) {
User.findById(userInstance.id, function(err, info) { 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.email, NEW_EMAIL);
assert.equal(info.emailVerified, false); assert.equal(info.emailVerified, false);
next(); next();
@ -2372,14 +2372,14 @@ describe('User', function() {
async.series([ async.series([
function updateUser(next) { function updateUser(next) {
userInstance.updateAttribute('email', NEW_EMAIL, function(err, info) { userInstance.updateAttribute('email', NEW_EMAIL, function(err, info) {
if (err) return next (err); if (err) return next(err);
assert.equal(info.email, NEW_EMAIL); assert.equal(info.email, NEW_EMAIL);
next(); next();
}); });
}, },
function findUser(next) { function findUser(next) {
User.findById(userInstance.id, function(err, info) { 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.email, NEW_EMAIL);
assert.equal(info.emailVerified, true); assert.equal(info.emailVerified, true);
next(); next();
@ -2394,14 +2394,14 @@ describe('User', function() {
async.series([ async.series([
function updateUser(next) { function updateUser(next) {
userInstance.updateAttribute('realm', 'test', function(err, info) { userInstance.updateAttribute('realm', 'test', function(err, info) {
if (err) return next (err); if (err) return next(err);
assert.equal(info.realm, 'test'); assert.equal(info.realm, 'test');
next(); next();
}); });
}, },
function findUser(next) { function findUser(next) {
User.findById(userInstance.id, function(err, info) { 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.realm, 'test');
assert.equal(info.emailVerified, true); assert.equal(info.emailVerified, true);
next(); next();
@ -2431,7 +2431,7 @@ describe('User', function() {
var email = validCredentialsEmailVerified.email; var email = validCredentialsEmailVerified.email;
User.resetPassword({email: email}, function(err, info) { User.resetPassword({email: email}, function(err, info) {
if (err) return done (err); if (err) return done(err);
done(); done();
}); });
}); });
@ -2445,7 +2445,7 @@ describe('User', function() {
assert(err); assert(err);
assert.equal(err.code, 'RESET_FAILED_EMAIL_NOT_VERIFIED'); assert.equal(err.code, 'RESET_FAILED_EMAIL_NOT_VERIFIED');
assert.equal(err.statusCode, 401); assert.equal(err.statusCode, 401);
done (); done();
}); });
}); });
@ -2455,7 +2455,7 @@ describe('User', function() {
var email = validCredentialsEmail; var email = validCredentialsEmail;
User.resetPassword({email: email}, function(err) { User.resetPassword({email: email}, function(err) {
if (err) return done (err); if (err) return done(err);
done(); done();
}); });
}); });