Skip to content

Commit cd716a2

Browse files
committedSep 2, 2019
fix lint errors
1 parent 69a6c84 commit cd716a2

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed
 

‎src/cli/run.js

+3-5
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function prettyPrint(argv, object, rules) {
1414

1515
console.log()
1616
console.log(chalk.bold(' Resources'))
17-
for (let prop in object) {
17+
for (const prop in object) {
1818
console.log(` ${root}/${prop}`)
1919
}
2020

@@ -37,7 +37,7 @@ function createApp(db, routes, middlewares, argv) {
3737

3838
const { foreignKeySuffix } = argv
3939

40-
let router = jsonServer.router(
40+
const router = jsonServer.router(
4141
db,
4242
foreignKeySuffix ? { foreignKeySuffix } : undefined
4343
)
@@ -138,9 +138,7 @@ module.exports = function(argv) {
138138
if (error.errno === 'EADDRINUSE')
139139
console.log(
140140
chalk.red(
141-
`Cannot bind to the port ${
142-
error.port
143-
}. Please specify another port number either through --port argument or through the json-server.json configuration file`
141+
`Cannot bind to the port ${error.port}. Please specify another port number either through --port argument or through the json-server.json configuration file`
144142
)
145143
)
146144
else console.log('Some error occurred', error)

‎src/server/mixins.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ function deepQuery(value, q) {
6262
}
6363
}
6464
} else if (_.isObject(value) && !_.isArray(value)) {
65-
for (let k in value) {
65+
for (const k in value) {
6666
if (_.deepQuery(value[k], q)) {
6767
return true
6868
}

‎src/server/router/plural.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,11 @@ module.exports = (db, name, opts) => {
5858
let _start = req.query._start
5959
let _end = req.query._end
6060
let _page = req.query._page
61-
let _sort = req.query._sort
62-
let _order = req.query._order
61+
const _sort = req.query._sort
62+
const _order = req.query._order
6363
let _limit = req.query._limit
64-
let _embed = req.query._embed
65-
let _expand = req.query._expand
64+
const _embed = req.query._embed
65+
const _expand = req.query._expand
6666
delete req.query.q
6767
delete req.query._start
6868
delete req.query._end
@@ -76,7 +76,7 @@ module.exports = (db, name, opts) => {
7676
// in the database
7777
Object.keys(req.query).forEach(query => {
7878
const arr = db.get(name).value()
79-
for (let i in arr) {
79+
for (const i in arr) {
8080
if (
8181
_.has(arr[i], query) ||
8282
query === 'callback' ||
@@ -100,7 +100,7 @@ module.exports = (db, name, opts) => {
100100
q = q.toLowerCase()
101101

102102
chain = chain.filter(obj => {
103-
for (let key in obj) {
103+
for (const key in obj) {
104104
const value = obj[key]
105105
if (db._.deepQuery(value, q)) {
106106
return true

0 commit comments

Comments
 (0)
Please sign in to comment.