eslint config 2.0 + remove extra empty lines
Upgrade eslint-config-loopback to ^2.0.0. Remove extra empty lines to make `npm run lint` pass again. [back-port of #909]
This commit is contained in:
parent
feca7481e9
commit
289eac7565
|
@ -82,5 +82,3 @@ User.create(user, function(err, u1) {
|
|||
console.log('Found: ', u2.toObject());
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -41,7 +41,3 @@ console.log(modelBuilder.definitions);
|
|||
User.mixin(Group);
|
||||
var user = new User({ name: 'Ray', group: 'Admin' });
|
||||
console.log(user);
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -482,7 +482,6 @@ function applyFilter(filter) {
|
|||
});
|
||||
}
|
||||
|
||||
|
||||
if (test(where[key], value)) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -2970,7 +2970,6 @@ DataAccessObject.prototype.reload = function reload(cb) {
|
|||
return this.constructor.findById(getIdValue(this.constructor, this), cb);
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Define readonly property on object
|
||||
*
|
||||
|
|
|
@ -697,7 +697,6 @@ Inclusion.include = function(objects, include, options, cb) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle Inclusion of Polymorphic HasOne relation
|
||||
* @param callback
|
||||
|
@ -827,7 +826,6 @@ Inclusion.include = function(objects, include, options, cb) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Handle Inclusion of EmbedsMany/EmbedsManyWithBelongsTo/EmbedsOne
|
||||
* Relations. Since Embedded docs are part of parents, no need to make
|
||||
|
|
|
@ -38,7 +38,6 @@ function buildOneToManyIdentityMapWithOrigKeys(objs, idName) {
|
|||
return kvMap;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Yeah, it joins. You need three things id -> obj1 map, id -> [obj2] map and merge function.
|
||||
* This functions will take each obj1, locate all data to join in map2 and call merge function.
|
||||
|
@ -56,7 +55,6 @@ function join(oneToOneIdMap, oneToManyIdMap, mergeF) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Map with arbitrary keys and values. User .set() and .get() to work with values instead of []
|
||||
* @returns {{set: Function, get: Function, remove: Function, exist: Function, getKeys: Function}}
|
||||
|
|
|
@ -63,5 +63,3 @@ module.exports = function getIntrospector(ModelBuilder) {
|
|||
ModelBuilder.introspect = introspectType;
|
||||
return introspectType;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -818,7 +818,6 @@ HasMany.prototype.exists = function(fkId, options, cb) {
|
|||
var modelInstance = this.modelInstance;
|
||||
cb = cb || utils.createPromiseCallback();
|
||||
|
||||
|
||||
this.findById(fkId, function(err, inst) {
|
||||
if (err) {
|
||||
return cb(err);
|
||||
|
@ -1052,8 +1051,6 @@ HasManyThrough.prototype.create = function create(data, options, cb) {
|
|||
return cb.promise;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Add the target model instance to the 'hasMany' relation
|
||||
* @param {Object|ID} acInst The actual instance or id value
|
||||
|
@ -1189,7 +1186,6 @@ HasManyThrough.prototype.remove = function(acInst, options, cb) {
|
|||
return cb.promise;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Declare "belongsTo" relation that sets up a one-to-one connection with
|
||||
* another model, such that each instance of the declaring model "belongs to"
|
||||
|
@ -1514,7 +1510,6 @@ BelongsTo.prototype.related = function(condOrRefresh, options, cb) {
|
|||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Define a Promise-based method for the belongsTo relation itself
|
||||
* - order.customer.get(cb): Load the target model instance asynchronously
|
||||
|
@ -1533,7 +1528,6 @@ BelongsTo.prototype.getAsync = function(options, cb) {
|
|||
return cb.promise;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* A hasAndBelongsToMany relation creates a direct many-to-many connection with
|
||||
* another model, with no intervening model. For example, if your application
|
||||
|
@ -2444,7 +2438,6 @@ EmbedsMany.prototype.related = function(receiver, scopeParams, condOrRefresh, op
|
|||
actualCond = condOrRefresh;
|
||||
}
|
||||
|
||||
|
||||
var embeddedList = this.embeddedList(receiver);
|
||||
|
||||
this.definition.applyScope(receiver, actualCond);
|
||||
|
|
|
@ -182,5 +182,3 @@ if (Transaction) {
|
|||
}
|
||||
|
||||
TransactionMixin.Transaction = Transaction;
|
||||
|
||||
|
||||
|
|
|
@ -110,7 +110,6 @@ operations.forEach(function(op) {
|
|||
|
||||
p.then(report, function(err) { console.error(err.stack); });
|
||||
|
||||
|
||||
function createOptimizedDataSource() {
|
||||
var ds = new DataSource({ connector: Memory });
|
||||
ds.name = 'Optimized';
|
||||
|
|
|
@ -447,7 +447,6 @@ describe('basic-querying', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
it('should only include fields as specified', function(done) {
|
||||
var remaining = 0;
|
||||
|
||||
|
|
|
@ -439,8 +439,6 @@ describe('hooks', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
|
||||
function addHooks(name, done) {
|
||||
var called = false, random = String(Math.floor(Math.random() * 1000));
|
||||
User['before' + name] = function(next, data) {
|
||||
|
|
|
@ -418,7 +418,6 @@ describe('include', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
// Not implemented correctly, see: loopback-datasource-juggler/issues/166
|
||||
// fixed by DB optimization
|
||||
it('should support include scope on hasAndBelongsToMany', function(done) {
|
||||
|
@ -579,7 +578,6 @@ describe('include', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
it('should not make n+1 db calls in relation syntax',
|
||||
function(done) {
|
||||
var self = this;
|
||||
|
|
|
@ -75,7 +75,6 @@ describe('include_util', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
describe('KVMap', function() {
|
||||
it('should allow to set and get value with key string', function() {
|
||||
var map = new includeUtils.KVMap();
|
||||
|
|
|
@ -735,7 +735,6 @@ describe('Load models with base', function() {
|
|||
u.should.have.property('email', 'x@y.com');
|
||||
});
|
||||
|
||||
|
||||
it('should set up base class via parent arg', function() {
|
||||
var ds = new ModelBuilder();
|
||||
|
||||
|
|
|
@ -1448,7 +1448,6 @@ describe('manipulation', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
describe('uuidv4 defaultFn', function() {
|
||||
var CustomModel;
|
||||
|
||||
|
|
|
@ -730,7 +730,6 @@ describe('Memory connector', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
describe('automigrate when NO models are attached', function() {
|
||||
var ds;
|
||||
beforeEach(function() {
|
||||
|
@ -988,5 +987,3 @@ describe('Memory connector with observers', function() {
|
|||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -3006,7 +3006,6 @@ module.exports = function(dataSource, should, connectorCapabilities) {
|
|||
}
|
||||
});
|
||||
|
||||
|
||||
function get(propertyName) {
|
||||
return function(obj) {
|
||||
return obj[propertyName];
|
||||
|
|
|
@ -1263,7 +1263,6 @@ describe('relations', function() {
|
|||
db.automigrate(['User', 'Follow'], done);
|
||||
});
|
||||
|
||||
|
||||
it('should set foreignKeys of through model correctly in first relation',
|
||||
function(done) {
|
||||
var follower = new User({ id: 1 });
|
||||
|
@ -3181,7 +3180,6 @@ describe('relations', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
describe('hasMany with primaryKey different from model PK', function() {
|
||||
var Employee, Boss;
|
||||
var COMPANY_ID = 'Company1';
|
||||
|
@ -3239,7 +3237,6 @@ describe('relations', function() {
|
|||
});
|
||||
});
|
||||
|
||||
|
||||
describe('belongsTo with primaryKey different from model PK', function() {
|
||||
var Employee, Boss;
|
||||
var COMPANY_ID = 'Company1';
|
||||
|
@ -3415,7 +3412,6 @@ describe('relations', function() {
|
|||
.catch(done);
|
||||
});
|
||||
|
||||
|
||||
it('should set targetClass on scope property', function() {
|
||||
should.equal(Article.prototype.tagNames._targetClass, 'TagName');
|
||||
});
|
||||
|
@ -5096,8 +5092,6 @@ describe('relations', function() {
|
|||
}).catch(done);
|
||||
});
|
||||
|
||||
|
||||
|
||||
it('should not allow duplicate record on scope with promises', function(done) {
|
||||
Category.findOne()
|
||||
.then(function(cat) {
|
||||
|
@ -5346,10 +5340,8 @@ describe('relations', function() {
|
|||
})
|
||||
.catch(done);
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
|
||||
describe('custom relation/scope methods', function() {
|
||||
var categoryId;
|
||||
|
||||
|
|
|
@ -329,10 +329,8 @@ describe('scope - filtered count, updateAll and destroyAll', function() {
|
|||
});
|
||||
|
||||
describe('scope - dynamic target class', function() {
|
||||
|
||||
var Collection, Media, Image, Video;
|
||||
|
||||
|
||||
before(function() {
|
||||
db = getSchema();
|
||||
Image = db.define('Image', { name: String });
|
||||
|
|
Loading…
Reference in New Issue