From 84322d07a962bcccbf4ef8ebdbd383c0765f9969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miroslav=20Bajto=C5=A1?= Date: Fri, 7 Dec 2018 15:43:40 +0100 Subject: [PATCH] Update eslint-config-loopback to latest --- lib/connectors/kv-memory.js | 2 +- lib/connectors/memory.js | 2 +- lib/date-string.js | 2 +- lib/geo.js | 2 +- lib/kvao/index.js | 2 +- lib/relation-definition.js | 18 +++++++++--------- lib/scope.js | 2 +- lib/utils.js | 6 +++--- package.json | 2 +- test/async-observer.test.js | 4 ++-- test/basic-querying.test.js | 2 +- test/common_test.js | 2 +- test/default-scope.test.js | 2 +- test/helpers/context-test-helpers.js | 2 +- test/helpers/hook-monitor.js | 2 +- test/kvao/_helpers.js | 6 +++--- test/kvao/expire.suite.js | 2 +- test/kvao/get-set.suite.js | 2 +- test/kvao/iterate-keys.suite.js | 2 +- test/relations.test.js | 2 +- 20 files changed, 33 insertions(+), 33 deletions(-) diff --git a/lib/connectors/kv-memory.js b/lib/connectors/kv-memory.js index 2e57a554..61415e86 100644 --- a/lib/connectors/kv-memory.js +++ b/lib/connectors/kv-memory.js @@ -25,7 +25,7 @@ function KeyValueMemoryConnector(settings, dataSource) { this._store = Object.create(null); this._setupRegularCleanup(); -}; +} util.inherits(KeyValueMemoryConnector, Connector); KeyValueMemoryConnector.prototype._setupRegularCleanup = function() { diff --git a/lib/connectors/memory.js b/lib/connectors/memory.js index cbc5f79b..c8f5489f 100644 --- a/lib/connectors/memory.js +++ b/lib/connectors/memory.js @@ -272,7 +272,7 @@ Memory.prototype.create = function create(model, data, options, callback) { return process.nextTick(function() { callback(err); }); - }; + } self.saveToFile(id, callback); }); }; diff --git a/lib/date-string.js b/lib/date-string.js index 80ff0e2e..6355d704 100644 --- a/lib/date-string.js +++ b/lib/date-string.js @@ -71,7 +71,7 @@ function DateString(value) { }); this.when = value; -}; +} /** * Returns the value of DateString in its original form. diff --git a/lib/geo.js b/lib/geo.js index fd2c4737..11b51ad1 100644 --- a/lib/geo.js +++ b/lib/geo.js @@ -38,7 +38,7 @@ exports.nearFilter = function nearFilter(where) { key: clauseKey, }); } - }; + } }); } var nearResults = []; diff --git a/lib/kvao/index.js b/lib/kvao/index.js index 371ee653..c3ac2b1b 100644 --- a/lib/kvao/index.js +++ b/lib/kvao/index.js @@ -1,7 +1,7 @@ 'use strict'; function KeyValueAccessObject() { -}; +} module.exports = KeyValueAccessObject; diff --git a/lib/relation-definition.js b/lib/relation-definition.js index 288a5564..b73e614a 100644 --- a/lib/relation-definition.js +++ b/lib/relation-definition.js @@ -71,7 +71,7 @@ function normalizeType(type) { } } return null; -}; +} function extendScopeMethods(definition, scopeMethods, ext) { var customMethods = []; @@ -87,7 +87,7 @@ function extendScopeMethods(definition, scopeMethods, ext) { var relation = new relationClass(definition, this); return relationMethod.apply(relation, arguments); }; - }; + } for (var key in ext) { var relationMethod = ext[key]; var method = scopeMethods[key] = createFunc(definition, relationMethod); @@ -98,7 +98,7 @@ function extendScopeMethods(definition, scopeMethods, ext) { } } return [].concat(customMethods || []); -}; +} function bindRelationMethods(relation, relationMethod, definition) { var methods = definition.methods || {}; @@ -106,7 +106,7 @@ function bindRelationMethods(relation, relationMethod, definition) { if (typeof methods[m] !== 'function') return; relationMethod[m] = methods[m].bind(relation); }); -}; +} function preventFkOverride(inst, data, fkProp) { if (!fkProp) return undefined; @@ -766,7 +766,7 @@ RelationDefinition.hasMany = function hasMany(modelFrom, modelToRef, params) { if (typeof method === 'function' && method.shared === true) { modelFrom.prototype['__' + methodName + '__' + relationName] = method; } - }; + } // Mix the property and scoped methods into the prototype class defineScope(modelFrom.prototype, params.through || modelTo, relationName, function() { @@ -2583,7 +2583,7 @@ RelationDefinition.embedsMany = function embedsMany(modelFrom, modelToRef, param if (typeof method === 'function' && method.shared === true) { modelFrom.prototype['__' + methodName + '__' + relationName] = method; } - }; + } // Mix the property and scoped methods into the prototype class var scopeDefinition = defineScope(modelFrom.prototype, modelTo, relationName, function() { @@ -2715,7 +2715,7 @@ EmbedsMany.prototype.findById = function(fkId, options, cb) { process.nextTick(function() { cb(null, item); }); - }; + } return item; // sync }; @@ -2897,7 +2897,7 @@ EmbedsMany.prototype.at = function(index, cb) { process.nextTick(function() { cb(null, item); }); - }; + } return item; // sync }; @@ -3198,7 +3198,7 @@ RelationDefinition.referencesMany = function referencesMany(modelFrom, modelToRe if (typeof method === 'function' && method.shared === true) { modelFrom.prototype['__' + methodName + '__' + relationName] = method; } - }; + } // Mix the property and scoped methods into the prototype class var scopeDefinition = defineScope(modelFrom.prototype, modelTo, relationName, function() { diff --git a/lib/scope.js b/lib/scope.js index 4dc2f290..b455330d 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -104,7 +104,7 @@ ScopeDefinition.prototype.related = function(receiver, scopeParams, condOrRefres // The filter applied on relatedModel var queryRelated = filter.scope; delete params.include.scope; - }; + } targetModel.find(params, options, function(err, data) { if (!err && saveOnCache) { diff --git a/lib/utils.js b/lib/utils.js index 3f218ea3..a64bb5d1 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -610,7 +610,7 @@ function sortObjectsByIds(idName, ids, objects, strict) { }); return heading.concat(tailing); -}; +} function createPromiseCallback() { var cb; @@ -725,7 +725,7 @@ function findIndexOf(arr, target, isEqual) { for (var i = 0; i < arr.length; i++) { if (isEqual(arr[i], target)) { return i; } - }; + } return -1; } @@ -741,7 +741,7 @@ function collectTargetIds(targetData, idPropertyName) { for (var i = 0; i < targetData.length; i++) { var targetId = targetData[i][idPropertyName]; targetIds.push(targetId); - }; + } var IdQuery = { inq: uniq(targetIds), }; diff --git a/package.json b/package.json index eba5bb61..978d428e 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "bson": "^4.0.1", "coveralls": "^3.0.1", "eslint": "^5.1.0", - "eslint-config-loopback": "^11.0.0", + "eslint-config-loopback": "^12.1.0", "loopback-connector-throwing": "file:./test/fixtures/loopback-connector-throwing", "mocha": "^5.2.0", "nyc": "^13.1.0", diff --git a/test/async-observer.test.js b/test/async-observer.test.js index d32a41be..c49a1473 100644 --- a/test/async-observer.test.js +++ b/test/async-observer.test.js @@ -119,7 +119,7 @@ describe('async observer', function() { function call(ctx, next) { notifications.push('call'); process.nextTick(next); - }; + } TestModel.observe('event', call); TestModel.removeObserver('event', call); @@ -137,7 +137,7 @@ describe('async observer', function() { function call(ctx, next) { notifications.push('call'); process.nextTick(next); - }; + } TestModel.observe('event', call); TestModel.observe('event', call); diff --git a/test/basic-querying.test.js b/test/basic-querying.test.js index 642fdff6..752d04d9 100644 --- a/test/basic-querying.test.js +++ b/test/basic-querying.test.js @@ -521,7 +521,7 @@ describe('basic-querying', function() { for (var ix = 0; ix < users.length; ix++) { users[ix].name.should.be.oneOf(['John Lennon', 'Stuart Sutcliffe', 'Paul McCartney']); users[ix].vip.should.be.true(); - }; + } done(); }); }); diff --git a/test/common_test.js b/test/common_test.js index aa5a5811..08e8c09c 100644 --- a/test/common_test.js +++ b/test/common_test.js @@ -577,7 +577,7 @@ function testOrm(dataSource) { function done() { if (--wait === 0) test.done(); - }; + } }); it('should return type of property', function(test) { diff --git a/test/default-scope.test.js b/test/default-scope.test.js index afdaecb5..3db2f23b 100644 --- a/test/default-scope.test.js +++ b/test/default-scope.test.js @@ -426,7 +426,7 @@ describe('default scope', function() { exists.should.be.false; done(); }); - }; + } before(function(done) { db.automigrate(setupProducts.bind(null, ids, done)); diff --git a/test/helpers/context-test-helpers.js b/test/helpers/context-test-helpers.js index 752cbb0f..54d9562c 100644 --- a/test/helpers/context-test-helpers.js +++ b/test/helpers/context-test-helpers.js @@ -15,7 +15,7 @@ function ContextRecorder(initialValue) { return new ContextRecorder(initialValue); } this.records = initialValue; -}; +} ContextRecorder.prototype.recordAndNext = function(transformFm) { var self = this; diff --git a/test/helpers/hook-monitor.js b/test/helpers/hook-monitor.js index 0197e197..ed94a46c 100644 --- a/test/helpers/hook-monitor.js +++ b/test/helpers/hook-monitor.js @@ -13,7 +13,7 @@ function HookMonitor(opts) { this.options = opts || {}; this.names = []; -}; +} HookMonitor.prototype.install = function(ObservedModel, hookNames) { var monitor = this; diff --git a/test/kvao/_helpers.js b/test/kvao/_helpers.js index f35ccd3d..7d4980dd 100644 --- a/test/kvao/_helpers.js +++ b/test/kvao/_helpers.js @@ -11,7 +11,7 @@ function givenCacheItem(dataSourceFactory) { value: 'Any', }; return givenModel(dataSourceFactory, 'CacheItem', modelProperties); -}; +} function givenModel(dataSourceFactory, modelName, modelProperties, options) { @@ -20,7 +20,7 @@ function givenModel(dataSourceFactory, modelName, const p = 'deleteAll' in dataSource.connector ? Model.deleteAll() : Promise.resolve(); return p.then(() => Model); -}; +} function givenKeys(Model, keys, cb) { var p = Promise.all( @@ -32,7 +32,7 @@ function givenKeys(Model, keys, cb) { p = p.then(function(r) { cb(null, r); }, cb); } return p; -}; +} function delay(ms) { return new Promise((resolve) => { diff --git a/test/kvao/expire.suite.js b/test/kvao/expire.suite.js index b1925fb6..95e644e8 100644 --- a/test/kvao/expire.suite.js +++ b/test/kvao/expire.suite.js @@ -65,6 +65,6 @@ module.exports = function(dataSourceFactory, connectorCapabilities) { function setupCacheItem() { return helpers.givenCacheItem(dataSourceFactory) .then(ModelCtor => CacheItem = ModelCtor); - }; + } }); }; diff --git a/test/kvao/get-set.suite.js b/test/kvao/get-set.suite.js index f36da12b..3e15f26e 100644 --- a/test/kvao/get-set.suite.js +++ b/test/kvao/get-set.suite.js @@ -102,6 +102,6 @@ module.exports = function(dataSourceFactory, connectorCapabilities) { function setupCacheItem() { return helpers.givenCacheItem(dataSourceFactory) .then(ModelCtor => CacheItem = ModelCtor); - }; + } }); }; diff --git a/test/kvao/iterate-keys.suite.js b/test/kvao/iterate-keys.suite.js index bbbff901..3dd81afd 100644 --- a/test/kvao/iterate-keys.suite.js +++ b/test/kvao/iterate-keys.suite.js @@ -47,7 +47,7 @@ module.exports = function(dataSourceFactory, connectorCapabilities) { function setupCacheItem() { return helpers.givenCacheItem(dataSourceFactory) .then(ModelCtor => CacheItem = ModelCtor); - }; + } }); }; diff --git a/test/relations.test.js b/test/relations.test.js index a0951586..7839bb3d 100644 --- a/test/relations.test.js +++ b/test/relations.test.js @@ -946,7 +946,7 @@ describe('relations', function() { }); }); }); - }; + } }); describe('find over related model with options', function() {