Skip to content

Commit 4f61ee2

Browse files
author
Tom Kirkpatrick
committed
chore: update to latest eslint
1 parent 746a9ae commit 4f61ee2

File tree

5 files changed

+14
-10
lines changed

5 files changed

+14
-10
lines changed

.eslintrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
{
22
"extends": "fullcube",
3-
"root": true
3+
"root": true,
4+
"rules": {
5+
"no-process-env": 0
6+
}
47
}

lib/index.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint filenames/match-regex: 0 */
21
'use strict'
32

43
const debug = require('debug')('loopback:component:ping')

lib/setup-model.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
1-
/* eslint global-require: 0 */
1+
'use strict'
2+
23
const debug = require('debug')('loopback:component:ping')
34
const modelDefinition = require('./models/ping.json')
5+
const ping = require('./models/ping')
46

57
// Remove properties that will confuse LB
68
function getModelSettings(def) {
79
const settings = {}
810

911
for (const s in def) {
10-
if (def.hasOwnProperty(s)) {
12+
if (Object.prototype.hasOwnProperty.call(def, s)) {
1113
if (s !== 'name' || s !== 'properties') {
1214
settings[s] = def[s]
1315
}
@@ -35,7 +37,8 @@ module.exports = function setupModelFn(app, options) {
3537

3638
if (typeof options.modelName !== 'undefined') {
3739
debug(`Overwriting model name to ${options.modelName} (default = Ping)`)
38-
modelDefinition.name = modelDefinition.plural = options.modelName
40+
modelDefinition.name = options.modelName
41+
modelDefinition.plural = options.modelName
3942
}
4043

4144
const ds = app.loopback.createDataSource('transient', { connector: 'transient' })
@@ -45,7 +48,7 @@ module.exports = function setupModelFn(app, options) {
4548
getModelSettings(modelDefinition)
4649
)
4750

48-
const Model = require('./models/ping')(newModel, options)
51+
const Model = ping(newModel, options)
4952

5053
app.model(Model)
5154
}

package.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,7 @@
3232
"conventional-commit-types": "^2.1.0",
3333
"cors": "^2.8.3",
3434
"coveralls": "^2.13.0",
35-
"eslint": "^3.19.0",
36-
"eslint-config-fullcube": "^1.0.46",
35+
"eslint-config-fullcube": "^2.0.2",
3736
"loopback": "^3.6.0",
3837
"loopback-boot": "^2.24.0",
3938
"loopback-component-explorer": "^4.2.0",

test/test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@
33
const path = require('path')
44
const chai = require('chai')
55

6-
const expect = chai.expect
6+
const { expect } = chai
77

88
const TEST_APP = path.join(__dirname, 'test-server')
99
const app = require(path.join(TEST_APP, 'server/server.js'))
10-
const Ping = app.models.Ping
10+
const Ping = app.loopback.getModel('Ping')
1111

1212
describe('Component Initialization', function() {
1313

0 commit comments

Comments
 (0)